aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_alb.c
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@gmail.com>2014-07-17 11:02:23 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-20 23:35:00 -0400
commit3e403a77779faf046862d91c36ef79fb4b12be9a (patch)
tree25f1b3b47eff4aa4e437d991b33f3438eed85eec /drivers/net/bonding/bond_alb.c
parent224e923cd9b001c612b7b68933264156271722f9 (diff)
bonding: make it possible to have unlimited nested upper vlans
Currently we're limited by a constant level of vlan nestings, and fail to find anything beyound that level (currently 2). To fix this - remove the limit of nestings when going through device tree, and when the end device is found - allocate the needed amount of vlan tags and return them, instead of found/not found. CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_alb.c')
-rw-r--r--drivers/net/bonding/bond_alb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index d3c6801f101e..95dd1f58c260 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -1042,7 +1042,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[],
1042 struct bonding *bond = bond_get_bond_by_slave(slave); 1042 struct bonding *bond = bond_get_bond_by_slave(slave);
1043 struct net_device *upper; 1043 struct net_device *upper;
1044 struct list_head *iter; 1044 struct list_head *iter;
1045 struct bond_vlan_tag tags[BOND_MAX_VLAN_ENCAP]; 1045 struct bond_vlan_tag *tags;
1046 1046
1047 /* send untagged */ 1047 /* send untagged */
1048 alb_send_lp_vid(slave, mac_addr, 0, 0); 1048 alb_send_lp_vid(slave, mac_addr, 0, 0);
@@ -1070,10 +1070,12 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[],
1070 * when strict_match is turned off. 1070 * when strict_match is turned off.
1071 */ 1071 */
1072 if (netif_is_macvlan(upper) && !strict_match) { 1072 if (netif_is_macvlan(upper) && !strict_match) {
1073 memset(tags, 0, sizeof(tags)); 1073 tags = bond_verify_device_path(bond->dev, upper, 0);
1074 bond_verify_device_path(bond->dev, upper, tags); 1074 if (IS_ERR_OR_NULL(tags))
1075 BUG();
1075 alb_send_lp_vid(slave, upper->dev_addr, 1076 alb_send_lp_vid(slave, upper->dev_addr,
1076 tags[0].vlan_proto, tags[0].vlan_id); 1077 tags[0].vlan_proto, tags[0].vlan_id);
1078 kfree(tags);
1077 } 1079 }
1078 } 1080 }
1079 rcu_read_unlock(); 1081 rcu_read_unlock();