diff mbox

[ovs-dev] bridge: Filter all zero mac when use ovs-vsctl to set mac

Message ID 1498727811-14088-1-git-send-email-zhongbaisong@huawei.com
State Accepted
Headers show

Commit Message

zhongbaisong June 29, 2017, 9:16 a.m. UTC
Signed-off-by: zhongbaisong <zhongbaisong@huawei.com>
---
 vswitchd/bridge.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ben Pfaff July 13, 2017, 5:35 p.m. UTC | #1
On Thu, Jun 29, 2017 at 05:16:51PM +0800, zhongbaisong wrote:
> Signed-off-by: zhongbaisong <zhongbaisong@huawei.com>

I applied this to master, because it seems reasonable to refuse this,
but if it causes problems for someone who really wants to do it then
we'll have to revert it.

Thank you for your contribution!
diff mbox

Patch

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 71f73d6..925edfc 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -4432,6 +4432,9 @@  iface_set_mac(const struct bridge *br, const struct port *port, struct iface *if
         } else if (eth_addr_is_multicast(*mac)) {
             VLOG_ERR("interface %s: cannot set MAC to multicast address",
                      iface->name);
+        } else if (eth_addr_is_zero(*mac)) {
+            VLOG_ERR("interface %s: cannot set MAC to all zero address",
+                     iface->name);
         } else {
             int error = netdev_set_etheraddr(iface->netdev, *mac);
             if (error) {