udev: net_setup_link: don't error out when we couldn't apply link config (#7328)
authorMichal Sekletar <msekletar@users.noreply.github.com>
Tue, 14 Nov 2017 18:29:37 +0000 (19:29 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 14 Nov 2017 18:29:37 +0000 (19:29 +0100)
It is possible that kernel will reject our netlink message that
configures the link. However, we should always make sure that interface
will be named properly otherwise we can leave interfaces having
unpredictable kernel names. Thus we don't return early and continue to
export name and link file properties.

Suggested-by: Tom Gundersen <teg@jklm.no>
src/udev/udev-builtin-net_setup_link.c

index 8e47775..291f4da 100644 (file)
@@ -51,10 +51,8 @@ static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv
         }
 
         r = link_config_apply(ctx, link, dev, &name);
-        if (r < 0) {
-                log_error_errno(r, "Could not apply link config to %s: %m", udev_device_get_sysname(dev));
-                return EXIT_FAILURE;
-        }
+        if (r < 0)
+                log_warning_errno(r, "Could not apply link config to %s, ignoring: %m", udev_device_get_sysname(dev));
 
         udev_builtin_add_property(dev, test, "ID_NET_LINK_FILE", link->filename);