[ovs-dev] [PATCH] bond: Drop packets on backup slaves.

Ethan Jackson ethan at nicira.com
Mon Jun 27 21:07:00 UTC 2011


---
That's fair, here is another version.  I need to test it before I merge it as
well.

Ethan
---
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 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/lib/bond.c b/lib/bond.c
index 913a307..d8e0966 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
-- 
1.7.5.2




More information about the dev mailing list