chiark / gitweb /
udev: link_config - ignore errors due to missing MAC address
authorTom Gundersen <teg@jklm.no>
Mon, 7 Jul 2014 12:50:16 +0000 (14:50 +0200)
committerTom Gundersen <teg@jklm.no>
Mon, 7 Jul 2014 13:03:12 +0000 (15:03 +0200)
Otherwis, we get misleading error messages on links with MACs.

Reported by Leonid Isaev.

src/udev/net/link-config.c

index b8650a6c6c315cda23a4aecf6e3cd7b7f1d688b2..5a45c53cc639c631e899c45014de9f517d3216d4 100644 (file)
@@ -383,7 +383,9 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, struct udev_dev
                 case MACPOLICY_PERSISTENT:
                         if (mac_is_random(device)) {
                                 r = get_mac(device, false, &generated_mac);
-                                if (r < 0)
+                                if (r == -ENOENT)
+                                        break;
+                                else if (r < 0)
                                         return r;
                                 mac = &generated_mac;
                         }
@@ -391,7 +393,9 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, struct udev_dev
                 case MACPOLICY_RANDOM:
                         if (!mac_is_random(device)) {
                                 r = get_mac(device, true, &generated_mac);
-                                if (r < 0)
+                                if (r == -ENOENT)
+                                        break;
+                                else if (r < 0)
                                         return r;
                                 mac = &generated_mac;
                         }