From 3e403a77779faf046862d91c36ef79fb4b12be9a Mon Sep 17 00:00:00 2001 From: Veaceslav Falico Date: Thu, 17 Jul 2014 17:02:23 +0200 Subject: 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 CC: Andy Gospodarek Signed-off-by: Veaceslav Falico Signed-off-by: David S. Miller --- drivers/net/bonding/bond_alb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/net/bonding/bond_alb.c') 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[], struct bonding *bond = bond_get_bond_by_slave(slave); struct net_device *upper; struct list_head *iter; - struct bond_vlan_tag tags[BOND_MAX_VLAN_ENCAP]; + struct bond_vlan_tag *tags; /* send untagged */ 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[], * when strict_match is turned off. */ if (netif_is_macvlan(upper) && !strict_match) { - memset(tags, 0, sizeof(tags)); - bond_verify_device_path(bond->dev, upper, tags); + tags = bond_verify_device_path(bond->dev, upper, 0); + if (IS_ERR_OR_NULL(tags)) + BUG(); alb_send_lp_vid(slave, upper->dev_addr, tags[0].vlan_proto, tags[0].vlan_id); + kfree(tags); } } rcu_read_unlock(); -- cgit v1.2.3