[ovs-dev] [ab-vlan-maint] bond: Drop packets on backup slaves.

Ethan Jackson ethan at nicira.com
Wed Jul 13 20:56:40 UTC 2011


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.
---
 vswitchd/bridge.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index d44f480..928d03c 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;
 }
 
-- 
1.7.6




More information about the dev mailing list