[netcf-devel] [PATCH] Check for MAC address 00:00:00:00:00:00

Jonas Eriksson jonas.j.eriksson at ericsson.com
Wed Aug 5 11:52:58 UTC 2009


src/dutil_linux.c: Running aug_get_mac on the interface lo will report
  the MAC address to be 00:00:00:00:00:00. This is now treated as if
  no MAC address was found.
---
 src/dutil_linux.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/dutil_linux.c b/src/dutil_linux.c
index 864bced..350ee51 100644
--- a/src/dutil_linux.c
+++ b/src/dutil_linux.c
@@ -87,6 +87,12 @@ int aug_get_mac(struct netcf *ncf, const char *intf, const char **mac) {
     r = aug_get(aug, path, mac);
     /* Messages for a aug_match-fail are handled outside this function */
 
+    /* The lo interface will report a MAC address of 00:00:00:00:00:00 */
+    if (mac != NULL && STREQ(*mac, "00:00:00:00:00:00")) {
+        r = 0;
+        (*mac) = NULL;
+    }
+
     /* fallthrough intentional */
  error:
     FREE(path);
-- 
1.6.2



More information about the netcf-devel mailing list