aboutsummaryrefslogtreecommitdiff
path: root/lib/lacp.c
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2012-03-02 12:24:55 -0800
committerEthan Jackson <ethan@nicira.com>2012-03-07 14:56:53 -0800
commit3e5b3fdbf52cee41142ed8e2bf5cab9f49146d97 (patch)
tree49c53afe08f06696b085990c396cb495f6e5efeb /lib/lacp.c
parentfd0aa9ead169c92a011a515c37d6cb4166da2747 (diff)
lacp: Notify LACP module when carrier changes.
Without this patch, when a slave's carrier goes down, the LACP module (as evidenced by ovs-appctl lacp/show) would consider the slave current until it hadn't received LACP PDUs for the requisite amount of time. It should instead, immediately mark the slave expired. This shouldn't actually affect the behavior of LACP bonds because the bond module won't choose to send traffic out a slave whose carrier is down. Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib/lacp.c')
-rw-r--r--lib/lacp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/lacp.c b/lib/lacp.c
index f7d5a82f..9eac4fe9 100644
--- a/lib/lacp.c
+++ b/lib/lacp.c
@@ -368,14 +368,16 @@ lacp_slave_unregister(struct lacp *lacp, const void *slave_)
}
/* This function should be called whenever the carrier status of 'slave_' has
- * changed. */
+ * changed. If 'lacp' is null, this function has no effect.*/
void
lacp_slave_carrier_changed(const struct lacp *lacp, const void *slave_)
{
- struct slave *slave = slave_lookup(lacp, slave_);
+ if (lacp) {
+ struct slave *slave = slave_lookup(lacp, slave_);
- if (slave->status == LACP_CURRENT || slave->lacp->active) {
- slave_set_expired(slave);
+ if (slave->status == LACP_CURRENT || slave->lacp->active) {
+ slave_set_expired(slave);
+ }
}
}