diff options
author | Tom Gundersen <teg@jklm.no> | 2014-01-29 21:24:44 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-01-30 14:30:39 +0100 |
commit | 50add2909c2e4b13a04d285b058b1c2270137656 (patch) | |
tree | 6ece9c372f2d850d7df78b6137fe8e6d71741184 /src/network/networkd.h | |
parent | 3815f36f05f8bc06904777b1eb7f1d22b78bcced (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.h')
-rw-r--r-- | src/network/networkd.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/networkd.h b/src/network/networkd.h index 01a8a7f681..831a9cbdd9 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -77,7 +77,7 @@ struct Netdev { int vlanid; - Link *link; + int ifindex; NetdevState state; LIST_HEAD(netdev_enslave_callback, callbacks); @@ -234,7 +234,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Netdev*, netdev_free); #define _cleanup_netdev_free_ _cleanup_(netdev_freep) int netdev_get(Manager *manager, const char *name, Netdev **ret); -int netdev_set_link(Manager *m, NetdevKind kind, Link *link); +int netdev_set_ifindex(Netdev *netdev, int ifindex); int netdev_enslave(Netdev *netdev, Link *link, sd_rtnl_message_handler_t cb); const char *netdev_kind_to_string(NetdevKind d) _const_; |