diff options
author | Ethan Jackson <ethan@nicira.com> | 2012-03-02 12:24:55 -0800 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2012-03-07 14:56:53 -0800 |
commit | 3e5b3fdbf52cee41142ed8e2bf5cab9f49146d97 (patch) | |
tree | 49c53afe08f06696b085990c396cb495f6e5efeb /lib/lacp.c | |
parent | fd0aa9ead169c92a011a515c37d6cb4166da2747 (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.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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); + } } } |