From: Ethan Jackson Date: Wed, 19 Jun 2013 21:34:35 +0000 (-0700) Subject: bond: Handle unknown slaves in bond_check_admissibility(). X-Git-Tag: sliver-openvswitch-1.10.90-3~6^2~25 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=4222bbc86cf229938c3d535a26311470c7bee9d2 bond: Handle unknown slaves in bond_check_admissibility(). In future patches, ofproto-dpif-xlate may be temporarily out of sync with ofproto-dpif and pass a non-bonded ofport into bond_check_admissibility(). This patch handles that edge case gracefully. Signed-off-by: Ethan Jackson Acked-by: Ben Pfaff --- diff --git a/lib/bond.c b/lib/bond.c index 11363152d..198db0f2b 100644 --- a/lib/bond.c +++ b/lib/bond.c @@ -557,6 +557,10 @@ bond_check_admissibility(struct bond *bond, const void *slave_, { struct bond_slave *slave = bond_slave_lookup(bond, slave_); + if (!slave) { + return BV_DROP; + } + /* LACP bonds have very loose admissibility restrictions because we can * assume the remote switch is aware of the bond and will "do the right * thing". However, as a precaution we drop packets on disabled slaves @@ -574,7 +578,7 @@ bond_check_admissibility(struct bond *bond, const void *slave_, /* Drop all multicast packets on inactive slaves. */ if (eth_addr_is_multicast(eth_dst)) { *tags |= bond_get_active_slave_tag(bond); - if (bond->active_slave != bond_slave_lookup(bond, slave_)) { + if (bond->active_slave != slave) { return BV_DROP; } }