lacp: Update attached status more often.
authorEthan Jackson <ethan@nicira.com>
Mon, 18 Apr 2011 22:32:30 +0000 (15:32 -0700)
committerEthan Jackson <ethan@nicira.com>
Tue, 19 Apr 2011 17:31:55 +0000 (10:31 -0700)
The attached status of slaves should be updated when certain global
configuration settings change, or when a slave is destroyed.

lib/lacp.c

index 9b3b14b5c93ccc5675ead5a5e75b44e2c9303554..a842fbe428ce9b212918d70255695b6b0a888a5e 100644 (file)
@@ -132,8 +132,13 @@ lacp_configure(struct lacp *lacp, const struct lacp_settings *s)
         lacp->name = xstrdup(s->name);
     }
 
-    memcpy(lacp->sys_id, s->id, ETH_ADDR_LEN);
-    lacp->sys_priority = s->priority;
+    if (!eth_addr_equals(lacp->sys_id, s->id)
+        || lacp->sys_priority != s->priority) {
+        memcpy(lacp->sys_id, s->id, ETH_ADDR_LEN);
+        lacp->sys_priority = s->priority;
+        lacp->update = true;
+    }
+
     lacp->active = s->active;
     lacp->fast = s->fast;
 }
@@ -225,6 +230,7 @@ lacp_slave_unregister(struct lacp *lacp, const void *slave_)
 
     if (slave) {
         slave_destroy(slave);
+        lacp->update = true;
     }
 }