bonding: Fix alb mode to only use first level vlans.
authorVlad Yasevich <vyasevic@redhat.com>
Fri, 16 May 2014 21:20:39 +0000 (17:20 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 17 May 2014 02:29:05 +0000 (22:29 -0400)
ALB/TLB learning packets use all vlans configured on top
of the bond.  This ends up being incorrect if we have a stack
of vlans on top of the bond.  ALB/TLB should only use
first level/outer most vlans in its announcements.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_alb.c

index 9f69e818b0009db7881b3f8c862393836e5a604b..e538478843198ba4ac5423d66bf8f6748c9b290b 100644 (file)
@@ -1045,7 +1045,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
        /* loop through vlans and send one packet for each */
        rcu_read_lock();
        netdev_for_each_all_upper_dev_rcu(bond->dev, upper, iter) {
-               if (upper->priv_flags & IFF_802_1Q_VLAN)
+               if (is_vlan_dev(upper) && vlan_get_encap_level(upper) == 0)
                        alb_send_lp_vid(slave, mac_addr,
                                        vlan_dev_vlan_id(upper));
        }