bridge: Reintroduce log message that was lost (and wrong).
authorBen Pfaff <blp@nicira.com>
Tue, 29 Mar 2011 18:16:31 +0000 (11:16 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 29 Apr 2011 21:31:59 +0000 (14:31 -0700)
Setting the 'mac' in the Interface record for a bridge's local port has
always been ineffective, but the log message was suppressed because of a
check at too high of a level.  This commit fixes the problem.  It also
fixes the wording of the log message, which has been obsolete since the
introduction of the database.

Finally, it seems better to check for the local port before checking for a
multicast address, so this reverses the order of the checks.

vswitchd/bridge.c

index bc05fdb..dcb25c6 100644 (file)
@@ -492,9 +492,7 @@ set_iface_properties(struct bridge *br OVS_UNUSED, struct iface *iface,
 
     /* Set MAC address of internal interfaces other than the local
      * interface. */
-    if (iface->dp_ifidx != ODPP_LOCAL && !strcmp(iface->type, "internal")) {
-        iface_set_mac(iface);
-    }
+    iface_set_mac(iface);
 
     return true;
 }
@@ -4491,13 +4489,15 @@ iface_set_mac(struct iface *iface)
 {
     uint8_t ea[ETH_ADDR_LEN];
 
-    if (iface->cfg->mac && eth_addr_from_string(iface->cfg->mac, ea)) {
-        if (eth_addr_is_multicast(ea)) {
+    if (!strcmp(iface->type, "internal")
+        && iface->cfg->mac && eth_addr_from_string(iface->cfg->mac, ea)) {
+        if (iface->dp_ifidx == ODPP_LOCAL) {
+            VLOG_ERR("interface %s: ignoring mac in Interface record "
+                     "(use Bridge record to set local port's mac)",
+                     iface->name);
+        } else if (eth_addr_is_multicast(ea)) {
             VLOG_ERR("interface %s: cannot set MAC to multicast address",
                      iface->name);
-        } else if (iface->dp_ifidx == ODPP_LOCAL) {
-            VLOG_ERR("ignoring iface.%s.mac; use bridge.%s.mac instead",
-                     iface->name, iface->name);
         } else {
             int error = netdev_set_etheraddr(iface->netdev, ea);
             if (error) {