Commit d6b694c0 authored by Vlad Yasevich's avatar Vlad Yasevich Committed by David S. Miller

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: default avatarVlad Yasevich <vyasevic@redhat.com>
Acked-by: default avatarVeaceslav Falico <vfalico@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a3431acf
...@@ -995,7 +995,7 @@ static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id) ...@@ -995,7 +995,7 @@ static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id)
/*********************** tlb/rlb shared functions *********************/ /*********************** tlb/rlb shared functions *********************/
static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[], static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
u16 vid) __be16 vlan_proto, u16 vid)
{ {
struct learning_pkt pkt; struct learning_pkt pkt;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -1021,7 +1021,7 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[], ...@@ -1021,7 +1021,7 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
skb->dev = slave->dev; skb->dev = slave->dev;
if (vid) { if (vid) {
skb = vlan_put_tag(skb, htons(ETH_P_8021Q), vid); skb = vlan_put_tag(skb, vlan_proto, vid);
if (!skb) { if (!skb) {
pr_err("%s: Error: failed to insert VLAN tag\n", pr_err("%s: Error: failed to insert VLAN tag\n",
slave->bond->dev->name); slave->bond->dev->name);
...@@ -1040,13 +1040,14 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) ...@@ -1040,13 +1040,14 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
struct list_head *iter; struct list_head *iter;
/* send untagged */ /* send untagged */
alb_send_lp_vid(slave, mac_addr, 0); alb_send_lp_vid(slave, mac_addr, 0, 0);
/* loop through vlans and send one packet for each */ /* loop through vlans and send one packet for each */
rcu_read_lock(); rcu_read_lock();
netdev_for_each_all_upper_dev_rcu(bond->dev, upper, iter) { netdev_for_each_all_upper_dev_rcu(bond->dev, upper, iter) {
if (is_vlan_dev(upper) && vlan_get_encap_level(upper) == 0) if (is_vlan_dev(upper) && vlan_get_encap_level(upper) == 0)
alb_send_lp_vid(slave, mac_addr, alb_send_lp_vid(slave, mac_addr,
vlan_dev_vlan_proto(upper),
vlan_dev_vlan_id(upper)); vlan_dev_vlan_id(upper));
} }
rcu_read_unlock(); rcu_read_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment