aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Yasevich <vyasevic@redhat.com>2014-05-21 11:24:39 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-22 15:44:58 -0400
commitd6b694c0b3f20c3ee54d29d4109fa1978d11a033 (patch)
tree11000f1c217b756b9351a7f57350b4e44c3f85af
parenta3431acf742455ba738c9fb143802d4ad6937164 (diff)
bonding: Don't assume 802.1Q when sending alb learning packets.
TLB/ALB learning packets always assume 802.1Q vlan protocol, but that is no longer the case since we now have support for Q-in-Q on top of bonding. Pass the vlan protocol to alb_send_lp_vid() so that the packets are properly tagged. CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Veaceslav Falico <vfalico@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Acked-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bonding/bond_alb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index e53847884319..2ec945c3b9ba 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -995,7 +995,7 @@ static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id)
995/*********************** tlb/rlb shared functions *********************/ 995/*********************** tlb/rlb shared functions *********************/
996 996
997static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[], 997static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
998 u16 vid) 998 __be16 vlan_proto, u16 vid)
999{ 999{
1000 struct learning_pkt pkt; 1000 struct learning_pkt pkt;
1001 struct sk_buff *skb; 1001 struct sk_buff *skb;
@@ -1021,7 +1021,7 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
1021 skb->dev = slave->dev; 1021 skb->dev = slave->dev;
1022 1022
1023 if (vid) { 1023 if (vid) {
1024 skb = vlan_put_tag(skb, htons(ETH_P_8021Q), vid); 1024 skb = vlan_put_tag(skb, vlan_proto, vid);
1025 if (!skb) { 1025 if (!skb) {
1026 pr_err("%s: Error: failed to insert VLAN tag\n", 1026 pr_err("%s: Error: failed to insert VLAN tag\n",
1027 slave->bond->dev->name); 1027 slave->bond->dev->name);
@@ -1040,13 +1040,14 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
1040 struct list_head *iter; 1040 struct list_head *iter;
1041 1041
1042 /* send untagged */ 1042 /* send untagged */
1043 alb_send_lp_vid(slave, mac_addr, 0); 1043 alb_send_lp_vid(slave, mac_addr, 0, 0);
1044 1044
1045 /* loop through vlans and send one packet for each */ 1045 /* loop through vlans and send one packet for each */
1046 rcu_read_lock(); 1046 rcu_read_lock();
1047 netdev_for_each_all_upper_dev_rcu(bond->dev, upper, iter) { 1047 netdev_for_each_all_upper_dev_rcu(bond->dev, upper, iter) {
1048 if (is_vlan_dev(upper) && vlan_get_encap_level(upper) == 0) 1048 if (is_vlan_dev(upper) && vlan_get_encap_level(upper) == 0)
1049 alb_send_lp_vid(slave, mac_addr, 1049 alb_send_lp_vid(slave, mac_addr,
1050 vlan_dev_vlan_proto(upper),
1050 vlan_dev_vlan_id(upper)); 1051 vlan_dev_vlan_id(upper));
1051 } 1052 }
1052 rcu_read_unlock(); 1053 rcu_read_unlock();