41 lines
1.8 KiB
Diff
41 lines
1.8 KiB
Diff
From 0afeabd2abb0f86c17f04558d84e39528d3eb9ee Mon Sep 17 00:00:00 2001
|
|
From: Tom Gundersen <teg@jklm.no>
|
|
Date: Mon, 7 Jul 2014 14:50:16 +0200
|
|
Subject: [PATCH] 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 a669ea9860900d5cdebbc4cb9aaea72db7e28a02)
|
|
---
|
|
src/udev/net/link-config.c | 8 ++++++--
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
|
|
index b8650a6c6c..5a45c53cc6 100644
|
|
--- a/src/udev/net/link-config.c
|
|
+++ b/src/udev/net/link-config.c
|
|
@@ -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;
|
|
}
|