From 966d14f910ba7efd83e330eafe712304dc436dc8 Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Tue, 12 Nov 2019 11:46:57 +0100 Subject: 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 --- executor/common_linux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'executor/common_linux.h') 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)); -- cgit mrf-deployment