udev: link_config - ignore errors due to missing MAC address

Otherwis, we get misleading error messages on links with MACs.

Reported by Leonid Isaev.

(cherry picked from commit a669ea9860)
This commit is contained in:
Tom Gundersen
2014-07-19 13:19:27 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent 14c30a407a
commit 0afeabd2ab
+6 -2
View 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;
}