Skip to content

Commit d5410ac

Browse files
Sun Shouxindavem330
authored andcommitted
net:bonding:support balance-alb interface with vlan to bridge
In my test, balance-alb bonding with two slaves eth0 and eth1, and then Bond0.150 is created with vlan id attached bond0. After adding bond0.150 into one linux bridge, I noted that Bond0, bond0.150 and bridge were assigned to the same MAC as eth0. Once bond0.150 receives a packet whose dest IP is bridge's and dest MAC is eth1's, the linux bridge will not match eth1's MAC entry in FDB, and not handle it as expected. The patch fix the issue, and diagram as below: eth1(mac:eth1_mac)--bond0(balance-alb,mac:eth0_mac)--eth0(mac:eth0_mac) | bond0.150(mac:eth0_mac) | bridge(ip:br_ip, mac:eth0_mac)--other port Suggested-by: Hu Yadi <huyd12@chinatelecom.cn> Signed-off-by: Sun Shouxin <sunshouxin@chinatelecom.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 91ec9bd commit d5410ac

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/bonding/bond_alb.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb,
653653
static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
654654
{
655655
struct slave *tx_slave = NULL;
656+
struct net_device *dev;
656657
struct arp_pkt *arp;
657658

658659
if (!pskb_network_may_pull(skb, sizeof(*arp)))
@@ -665,6 +666,12 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
665666
if (!bond_slave_has_mac_rx(bond, arp->mac_src))
666667
return NULL;
667668

669+
dev = ip_dev_find(dev_net(bond->dev), arp->ip_src);
670+
if (dev) {
671+
if (netif_is_bridge_master(dev))
672+
return NULL;
673+
}
674+
668675
if (arp->op_code == htons(ARPOP_REPLY)) {
669676
/* the arp must be sent on the selected rx channel */
670677
tx_slave = rlb_choose_channel(skb, bond, arp);

0 commit comments

Comments
 (0)