From cd17bb6e71c364049b18046a1b20475988de8ff3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 12 Dec 2018 21:32:29 +0100 Subject: [PATCH] networkd: consider any uevent other than "remove" sufficient for the network device to be ready --- src/network/networkd-manager.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index a6c1a39e23..a697e2133a 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -223,14 +223,16 @@ static int manager_udev_process_link(sd_device_monitor *monitor, sd_device *devi return 0; } - if (!IN_SET(action, DEVICE_ACTION_ADD, DEVICE_ACTION_CHANGE, DEVICE_ACTION_MOVE)) { - log_device_debug(device, "Ignoring udev %s event for device.", device_action_to_string(action)); + /* Ignore the "remove" uevent — let's remove a device only if rtnetlink says so. All other uevents + * are "positive" events in some form, i.e. inform us about a changed or new network interface, that + * still exists — and we are interested in that. */ + if (action == DEVICE_ACTION_REMOVE) return 0; - } r = sd_device_get_ifindex(device, &ifindex); if (r < 0) { - log_device_debug_errno(device, r, "Ignoring udev ADD event for device without ifindex or with invalid ifindex: %m"); + log_device_debug_errno(device, r, "Ignoring udev %s event for device without ifindex or with invalid ifindex: %m", + device_action_to_string(action)); return 0; }