From 7ba7dcf014a9f830f99967907534bbd5e32dfc36 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Mon, 27 Jun 2011 13:18:19 -0700 Subject: [PATCH] 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. --- lib/bond.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 -- 2.45.2