[ovs-dev] [lacp_bugs 4/7] lacp: Require non-zero system ID.

Ethan Jackson ethan at nicira.com
Wed Nov 30 21:51:24 UTC 2011


Good catch, I missed this in testing because we typcially set a non-zero
sys_priority.

I'll update the comments of the lacp_settings struct in a future patch.

Ethan

---
 lib/lacp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/lacp.c b/lib/lacp.c
index 9e63bbb..6ee55c3 100644
--- a/lib/lacp.c
+++ b/lib/lacp.c
@@ -224,6 +224,8 @@ lacp_destroy(struct lacp *lacp)
 void
 lacp_configure(struct lacp *lacp, const struct lacp_settings *s)
 {
+    assert(!eth_addr_is_zero(s->id));
+
     if (!lacp->name || strcmp(s->name, lacp->name)) {
         free(lacp->name);
         lacp->name = xstrdup(s->name);
@@ -232,7 +234,6 @@ lacp_configure(struct lacp *lacp, const struct lacp_settings *s)
     if (!eth_addr_equals(lacp->sys_id, s->id)
         || lacp->sys_priority != s->priority
         || lacp->heartbeat != s->heartbeat) {
-        assert(!eth_addr_is_zero(s->id));
         memcpy(lacp->sys_id, s->id, ETH_ADDR_LEN);
         lacp->sys_priority = s->priority;
         lacp->heartbeat = s->heartbeat;
-- 
1.7.7.1




More information about the dev mailing list