chiark / gitweb /
networkd: netdev - reduce chance of race when receiving netdev's ifindex
authorTom Gundersen <teg@jklm.no>
Wed, 29 Jan 2014 20:24:44 +0000 (21:24 +0100)
committerTom Gundersen <teg@jklm.no>
Thu, 30 Jan 2014 13:30:39 +0000 (14:30 +0100)
commit50add2909c2e4b13a04d285b058b1c2270137656
tree6ece9c372f2d850d7df78b6137fe8e6d71741184
parent3815f36f05f8bc06904777b1eb7f1d22b78bcced
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
src/network/networkd-manager.c
src/network/networkd-netdev.c
src/network/networkd.h