diff mbox

[ovs-dev] bridge: Add assertion to document an invariant in find_local_hw_addr().

Message ID 1467519415-24794-1-git-send-email-blp@ovn.org
State Accepted
Headers show

Commit Message

Ben Pfaff July 3, 2016, 4:16 a.m. UTC
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 vswitchd/bridge.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 8ebfc66..805b784 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1997,6 +1997,9 @@  find_local_hw_addr(const struct bridge *br, struct eth_addr *ea,
                 }
             }
 
+            /* A port always has at least one interface. */
+            ovs_assert(iface != NULL);
+
             /* The local port doesn't count (since we're trying to choose its
              * MAC address anyway). */
             if (iface->ofp_port == OFPP_LOCAL) {