Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sun Shouxin and committed by
David S. Miller
d5410ac7 91ec9bd5

+7
+7
drivers/net/bonding/bond_alb.c
··· 653 653 static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) 654 654 { 655 655 struct slave *tx_slave = NULL; 656 + struct net_device *dev; 656 657 struct arp_pkt *arp; 657 658 658 659 if (!pskb_network_may_pull(skb, sizeof(*arp))) ··· 665 664 */ 666 665 if (!bond_slave_has_mac_rx(bond, arp->mac_src)) 667 666 return NULL; 667 + 668 + dev = ip_dev_find(dev_net(bond->dev), arp->ip_src); 669 + if (dev) { 670 + if (netif_is_bridge_master(dev)) 671 + return NULL; 672 + } 668 673 669 674 if (arp->op_code == htons(ARPOP_REPLY)) { 670 675 /* the arp must be sent on the selected rx channel */