diff options
| author | Joe Hershberger <joe.hershberger@ni.com> | 2018-07-02 14:47:52 -0500 |
|---|---|---|
| committer | Joe Hershberger <joe.hershberger@ni.com> | 2018-07-26 14:08:18 -0500 |
| commit | c9e2caff8503b0dfa750b5ed08f882919fd3b510 (patch) | |
| tree | 37c9f94265e4fe0be0a8cec139cb42b9b18f0df3 /arch/sandbox/cpu/eth-raw-os.c | |
| parent | ac13270b49d55677aeea5a64dfbf1764118820e3 (diff) | |
sandbox: eth-raw: Allow interface to be specified by index
With systemd stable interface names, eth0 will almost never exist.
Instead of using that name in the sandbox.dts, use an index.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/cpu/eth-raw-os.c')
| -rw-r--r-- | arch/sandbox/cpu/eth-raw-os.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/eth-raw-os.c b/arch/sandbox/cpu/eth-raw-os.c index 12ddb345d92..df7acaa0bc8 100644 --- a/arch/sandbox/cpu/eth-raw-os.c +++ b/arch/sandbox/cpu/eth-raw-os.c @@ -44,6 +44,13 @@ out: return ret; } +int sandbox_eth_raw_os_idx_to_name(struct eth_sandbox_raw_priv *priv) +{ + if (!if_indextoname(priv->host_ifindex, priv->host_ifname)) + return -errno; + return 0; +} + static int _raw_packet_start(struct eth_sandbox_raw_priv *priv, unsigned char *ethmac) { |
