[ovs-dev] interface mac setting

Tonghao Zhang xiangxia.m.yue at gmail.com
Tue Apr 24 02:55:36 UTC 2018

One question, why now ovs can only set the mac of internal interface,
for example:

ovs-vsctl set Interface p1 type=internal mac=\"00:11:22:33:44:55\"
ovs-vsctl get Interface p1 mac_in_use

And the doc about 'mac' is not explained, why we cannot set it for
other type interface. So it's a bug?

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index d90997e..28dd7f8 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -4416,10 +4416,6 @@ iface_set_mac(const struct bridge *br, const
struct port *port, struct iface *if
     struct eth_addr ea, *mac = NULL;
     struct iface *hw_addr_iface;

-    if (strcmp(iface->type, "internal")) {
-        return;
-    }
     if (iface->cfg->mac && eth_addr_from_string(iface->cfg->mac, &ea)) {
         mac = &ea;
     } else if (port->cfg->fake_bridge) {

More information about the dev mailing list