X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fbond.c;h=f5ccf27911d3f7b34df7eee7929913a7635d18a4;hb=6333a605d7471bd49b24f5681c6461e9b2188fe1;hp=73ee814cd5f92a62a9f15236edc77702c4158c17;hpb=4133900f2d787d9197b7565e8f69819eeebaad0b;p=sliver-openvswitch.git diff --git a/lib/bond.c b/lib/bond.c index 73ee814cd..f5ccf2791 100644 --- a/lib/bond.c +++ b/lib/bond.c @@ -578,9 +578,10 @@ 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) { + switch (bond->balance) { + case BM_AB: + /* Drop all packets which arrive on backup slaves. This is similar to + * how Linux bonding handles active-backup bonds. */ *tags |= bond_get_active_slave_tag(bond); if (bond->active_slave != slave) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); @@ -590,14 +591,27 @@ bond_check_admissibility(struct bond *bond, const void *slave_, slave->name, ETH_ADDR_ARGS(eth_dst)); return BV_DROP; } + return BV_ACCEPT; + + case BM_TCP: + /* TCP balancing has degraded to SLB (otherwise the + * bond->lacp_negotiated check above would have processed this). + * + * Fall through. */ + case BM_SLB: + /* 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 has moved to another switch. The exception to the + * exception is if we locked the learning table to avoid reflections on + * bond slaves. */ + return BV_DROP_IF_MOVED; + + case BM_STABLE: + return BV_ACCEPT; } - /* 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 - * has moved to another switch. The exception to the exception is if we - * locked the learning table to avoid reflections on bond slaves. */ - return BV_DROP_IF_MOVED; + NOT_REACHED(); } /* Returns the slave (registered on 'bond' by bond_slave_register()) to which