From: Ethan Jackson Date: Mon, 27 Jun 2011 20:18:19 +0000 (-0700) Subject: bond: Drop packets on backup slaves. X-Git-Tag: v1.2.0~124 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7ba7dcf014a9f830f99967907534bbd5e32dfc36;p=sliver-openvswitch.git bond: Drop packets on backup slaves. Currently, OVS accepts incoming traffic on all slaves participating in a bond. In Linux active-backup bonding, all traffic which comes in on backup slaves is dropped. This patch causes OVS to do the same. Bug #6125. --- diff --git a/lib/bond.c b/lib/bond.c index 913a3071a..d8e0966e8 100644 --- a/lib/bond.c +++ b/lib/bond.c @@ -573,6 +573,22 @@ bond_check_admissibility(struct bond *bond, const void *slave_, } } + /* Drop all packets which arrive on backup slaves. This is similar to how + * Linux bonding handles active-backup bonds. */ + if (bond->balance == BM_AB) { + struct bond_slave *slave = bond_slave_lookup(bond, slave_); + + *tags |= bond_get_active_slave_tag(bond); + if (bond->active_slave != slave) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); + + VLOG_WARN_RL(&rl, "active-backup bond received packet on backup" + " slave (%s) destined for " ETH_ADDR_FMT, + slave->name, ETH_ADDR_ARGS(eth_dst)); + return BV_DROP; + } + } + /* Drop all packets for which we have learned a different input port, * because we probably sent the packet on one slave and got it back on the * other. Gratuitous ARP packets are an exception to this rule: the host