summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index bf48331129..8b0ef8f076 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1488,21 +1488,13 @@ static int link_check_initialized(Link *link) {
return link_initialized(link, device);
}
-int manager_udev_process_link(sd_device_monitor *monitor, sd_device *device, void *userdata) {
- sd_device_action_t action;
- Manager *m = userdata;
- Link *link = NULL;
+int manager_udev_process_link(Manager *m, sd_device *device, sd_device_action_t action) {
int r, ifindex;
+ Link *link;
assert(m);
assert(device);
- r = sd_device_get_action(device, &action);
- if (r < 0) {
- log_device_debug_errno(device, r, "Failed to get udev action, ignoring device: %m");
- return 0;
- }
-
/* 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. */
@@ -1510,25 +1502,20 @@ int manager_udev_process_link(sd_device_monitor *monitor, sd_device *device, voi
return 0;
r = sd_device_get_ifindex(device, &ifindex);
- if (r < 0) {
- 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;
- }
+ if (r < 0)
+ return log_device_debug_errno(device, r, "Failed to get ifindex: %m");
r = device_is_renaming(device);
- if (r < 0) {
- log_device_debug_errno(device, r, "Failed to determine the device is renamed or not, ignoring '%s' uevent: %m",
- device_action_to_string(action));
- return 0;
- }
+ if (r < 0)
+ return log_device_debug_errno(device, r, "Failed to determine if the device is renaming or not: %m");
if (r > 0) {
- log_device_debug(device, "Interface is under renaming, wait for the interface to be renamed.");
+ log_device_debug(device, "Device is renaming, waiting for the interface to be renamed.");
return 0;
}
r = link_get_by_index(m, ifindex, &link);
if (r < 0) {
+ /* This error is not critical, as the corresponding rtnl message may be received later. */
log_device_debug_errno(device, r, "Failed to get link from ifindex %i, ignoring: %m", ifindex);
return 0;
}