From 0fc2dcf0c768e23dc1cf359466b1e022b692c7c9 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 29 Mar 2011 11:16:31 -0700 Subject: [PATCH] bridge: Reintroduce log message that was lost (and wrong). 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 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index bc05fdbcf..dcb25c66e 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -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) { -- 2.43.0