diff options
| author | Jiri Pirko <jiri@mellanox.com> | 2019-11-12 11:46:57 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-11-14 09:21:37 +0100 |
| commit | 966d14f910ba7efd83e330eafe712304dc436dc8 (patch) | |
| tree | 64de38a39f2e9e6fc86bd9f8c4c6631e8b3e880d /executor/common_linux.h | |
| parent | d5f798b079efa4c95ac265a974e12d0c07685757 (diff) | |
executor: identify netdev by ifindex in netlink_device_change()
IFLA_NAME is going to be used to set the name of the netdevice, so
change the handle to be ifindex.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Diffstat (limited to 'executor/common_linux.h')
| -rw-r--r-- | executor/common_linux.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index 2fcf588bf..30d189667 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -257,8 +257,8 @@ static void netlink_device_change(int sock, const char* name, bool up, memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; + hdr.ifi_index = if_nametoindex(name); netlink_init(RTM_NEWLINK, 0, &hdr, sizeof(hdr)); - netlink_attr(IFLA_IFNAME, name, strlen(name)); if (master) { int ifindex = if_nametoindex(master); netlink_attr(IFLA_MASTER, &ifindex, sizeof(ifindex)); |
