From 50add2909c2e4b13a04d285b058b1c2270137656 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Wed, 29 Jan 2014 21:24:44 +0100 Subject: networkd: netdev - reduce chance of race when receiving netdev's ifindex When creating a new link, the kernel will not inform us about the new ifindex in its ack. We have to listen for newly created devices and deduce the new ifindex by matching on the ifname. We used to do this by waiting for a new device from libudev, but that is asking for trouble, as udev will happily rename the device before handing it to us. Listen on rtnl instead, the chance of the name being changed before reaching us is much smaller (if not nil). Kernel patch in the works to make this unneccessary. --- src/network/networkd-link.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/network/networkd-link.c') diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index f021918311..363602e962 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -96,7 +96,6 @@ int link_add(Manager *m, struct udev_device *device, Link **ret) { Network *network; int r; uint64_t ifindex; - NetdevKind kind; assert(m); assert(device); @@ -114,13 +113,6 @@ int link_add(Manager *m, struct udev_device *device, Link **ret) { *ret = link; - kind = netdev_kind_from_string(udev_device_get_devtype(device)); - if (kind != _NETDEV_KIND_INVALID) { - r = netdev_set_link(m, kind, link); - if (r < 0 && r != -ENOENT) - return r; - } - r = network_get(m, device, &network); if (r < 0) return r == -ENOENT ? 0 : r; -- cgit v1.2.3-54-g00ecf