bond: Revalidate when lacp_negotiated status changes.
authorEthan Jackson <ethan@nicira.com>
Mon, 28 Nov 2011 23:14:11 +0000 (15:14 -0800)
committerEthan Jackson <ethan@nicira.com>
Tue, 17 Jan 2012 02:14:56 +0000 (18:14 -0800)
Typically, when the lacp_negotiated flag changes, the result of
bond_is_tcp_hash() will change as well.  However, for certain bond
types (SLB, Active-Backup, etc) this may not be true.  Since the
lacp_negotiated flag affects the results of
bond_check_admissibility() revalidation needs to happen whenever it
changes.  This patch makes the revalidation explicit.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
lib/bond.c

index 79fc18c1ab6eb8d27ef1244ccbccf1b5bd5035ea..a2105ca3f4d277e7838235d925922d2af049eaee 100644 (file)
@@ -407,7 +407,10 @@ bond_run(struct bond *bond, struct tag_set *tags, bool lacp_negotiated)
     struct bond_slave *slave;
     bool is_tcp_hash = bond_is_tcp_hash(bond);
 
-    bond->lacp_negotiated = lacp_negotiated;
+    if (bond->lacp_negotiated != lacp_negotiated) {
+        bond->lacp_negotiated = lacp_negotiated;
+        bond->bond_revalidate = true;
+    }
 
     /* Enable slaves based on link status and LACP feedback. */
     HMAP_FOR_EACH (slave, hmap_node, &bond->slaves) {