summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-01-29 21:24:44 +0100
committerTom Gundersen <teg@jklm.no>2014-01-30 14:30:39 +0100
commit50add2909c2e4b13a04d285b058b1c2270137656 (patch)
tree6ece9c372f2d850d7df78b6137fe8e6d71741184 /src/network/networkd-link.c
parent3815f36f05f8bc06904777b1eb7f1d22b78bcced (diff)
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.
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c8
1 files changed, 0 insertions, 8 deletions
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;