[systemd-bugs] [Bug 56929] udev makes network interfaces available before it has renamed them

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Nov 26 09:33:12 PST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=56929

--- Comment #7 from Daniel Drake <dsd at laptop.org> ---
I've investigated further:

On startup, NetworkManager starts listening for uevents via libgudev (to be
informed of new network devices that get added later), and then enumerates all
existing network devices:

    devices = g_udev_client_query_by_subsystem (priv->client, "net");
    for (iter = devices; iter; iter = g_list_next (iter)) {
        net_add (self, G_UDEV_DEVICE (iter->data));

This is hitting a race. libudev's enumeration works directly with /sys, without
consulting udevd. In this case, udevd has not finished reading/applying all the
relevant rules to the device, but libudev finds it anyway, and hands it over to
NetworkManager.

I added some debug messages in NM and udevd and can confirm that the following
is happening:

1. system boots
2. Network device is detected
3. NetworkManager starts, queries available network devices, finds the device
4. NetworkManager brings the network device up
5. udevd starts processing of the network device
6. udevd tries to rename the network device, fails, its in use
7. udevd announces presence of the network device to libudev listeners

I can't imagine this is the only race caused by the fact that libudev's
enumeration doesn't seem to synchronise with udevd before presenting devices.
What options do we have to solve this?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20121126/e9c602eb/attachment.html>


More information about the systemd-bugs mailing list