From: Ethan Jackson Date: Wed, 13 Jul 2011 18:50:10 +0000 (-0700) Subject: bond: Drop packets on backup slaves. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f8d9cc53659d29a0c047f3718b02efaf6d1cce3b;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/vswitchd/bridge.c b/vswitchd/bridge.c index d44f4803b..928d03ce3 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -3016,6 +3016,21 @@ is_admissible(struct bridge *br, const struct flow *flow, bool have_packet, } } + /* Drop all packets which arrive on backup slaves. This is similar to how + * Linux bonding handles active-backup bonds. */ + if (in_port->bond_mode == BM_AB) { + + *tags |= in_port->active_iface; + if (in_port->active_iface != in_iface->port_ifidx) { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); + + VLOG_WARN_RL(&rl, "active-backup bond received packet on backup" + " interface (%s) destined for " ETH_ADDR_FMT, + in_iface->name, ETH_ADDR_ARGS(flow->dl_dst)); + return false ; + } + } + return true; }