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 |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/lib/bond.c b/lib/bond.c
index 913a307..89cd49b 100644
--- a/lib/bond.c
+++ b/lib/bond.c
@@ -559,16 +559,28 @@ enum bond_verdict
 bond_check_admissibility(struct bond *bond, const void *slave_,
                          const uint8_t eth_dst[ETH_ADDR_LEN], tag_type *tags)
 {
+    static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
+    struct bond_slave *slave = bond_slave_lookup(bond, slave_);
+
     /* Admit all packets if LACP has been negotiated, because that means that
      * the remote switch is aware of the bond and will "do the right thing". */
     if (bond->lacp_negotiated) {
         return BV_ACCEPT;
     }
 
-    /* Drop all multicast packets on inactive slaves. */
-    if (eth_addr_is_multicast(eth_dst)) {
+    /* Drop all multicast packets on inactive slaves. When in active-backup
+     * mode, drop all packets arriving on backup slaves. */
+    if (eth_addr_is_multicast(eth_dst) || bond->balance == BM_AB) {
+
         *tags |= bond_get_active_slave_tag(bond);
-        if (bond->active_slave != bond_slave_lookup(bond, slave_)) {
+        if (bond->active_slave != slave) {
+            if (!eth_addr_is_multicast(eth_dst)) {
+                VLOG_WARN_RL(&rl, "active-backup bond received non-multicast "
+                             "packet on backup slave (%s) destined for "
+                             ETH_ADDR_FMT, slave->name,
+                             ETH_ADDR_ARGS(eth_dst));
+            }
+
             return BV_DROP;
         }
     }
-- 
1.7.5.2

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to