@@ -2392,20 +2392,18 @@ re_arm:
static int bond_has_this_ip(struct bonding *bond, __be32 ip)
{
- struct vlan_entry *vlan;
struct net_device *vlan_dev;
if (ip == bond_confirm_addr(bond->dev, 0, ip))
return 1;
- list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
- rcu_read_lock();
- vlan_dev = __vlan_find_dev_deep(bond->dev, htons(ETH_P_8021Q),
- vlan->vlan_id);
- rcu_read_unlock();
- if (vlan_dev && ip == bond_confirm_addr(vlan_dev, 0, ip))
+ rcu_read_lock();
+ while ((vlan_dev = __vlan_find_dev_next(bond->dev, vlan_dev)))
+ if (ip == bond_confirm_addr(vlan_dev, 0, ip)) {
+ rcu_read_unlock();
return 1;
- }
+ }
+ rcu_read_unlock();
return 0;
}
RFC -> v1: use the new __vlan_find_dev_next(), which simplifies the code and omits issues with vlan id 0. Use __vlan_find_dev_next() to loop through dev's vlan devices and verify if the ip matches. CC: Jay Vosburgh <fubar@us.ibm.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@redhat.com> --- drivers/net/bonding/bond_main.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-)