chiark / gitweb /
networkd: link - ignore missing MAC address from NEWLINK message
authorTom Gundersen <teg@jklm.no>
Sun, 13 Apr 2014 20:10:34 +0000 (22:10 +0200)
committerTom Gundersen <teg@jklm.no>
Mon, 14 Apr 2014 15:53:01 +0000 (17:53 +0200)
The kernel may broadcast such messages, simply discard them.

src/network/networkd-link.c

index 7f81538..927dbb1 100644 (file)
@@ -1490,10 +1490,10 @@ int link_update(Link *link, sd_rtnl_message *m) {
                                        PRIu16, link->original_mtu);
         }
 
+        /* The kernel may broadcast NEWLINK messages without the MAC address
+           set, simply ignore them. */
         r = sd_rtnl_message_read_ether_addr(m, IFLA_ADDRESS, &mac);
-        if (r < 0)
-                log_debug_link(link, "Could not get MAC address: %s", strerror(-r));
-        else {
+        if (r >= 0) {
                 if (memcmp(link->mac.ether_addr_octet, mac.ether_addr_octet, ETH_ALEN)) {
 
                         memcpy(link->mac.ether_addr_octet, mac.ether_addr_octet, ETH_ALEN);