Commit 50223ce4 authored by Veaceslav Falico's avatar Veaceslav Falico Committed by David S. Miller

bonding: convert bond_has_this_ip() to use upper devices

Currently, bond_has_this_ip() is aware only of vlan upper devices, and thus
will return false if the address is associated with the upper bridge or any
other device, and thus will break the arp logic.

Fix this by using the upper device list. For every upper device we verify
if the address associated with it is our address, and if yes - return true.

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 27bc11e6
...@@ -2392,24 +2392,25 @@ void bond_mii_monitor(struct work_struct *work) ...@@ -2392,24 +2392,25 @@ void bond_mii_monitor(struct work_struct *work)
} }
} }
static int bond_has_this_ip(struct bonding *bond, __be32 ip) static bool bond_has_this_ip(struct bonding *bond, __be32 ip)
{ {
struct vlan_entry *vlan; struct net_device *upper;
struct net_device *vlan_dev; struct list_head *iter;
bool ret = false;
if (ip == bond_confirm_addr(bond->dev, 0, ip)) if (ip == bond_confirm_addr(bond->dev, 0, ip))
return 1; return true;
list_for_each_entry(vlan, &bond->vlan_list, vlan_list) { rcu_read_lock();
rcu_read_lock(); netdev_for_each_upper_dev_rcu(bond->dev, upper, iter) {
vlan_dev = __vlan_find_dev_deep(bond->dev, htons(ETH_P_8021Q), if (ip == bond_confirm_addr(upper, 0, ip)) {
vlan->vlan_id); ret = true;
rcu_read_unlock(); break;
if (vlan_dev && ip == bond_confirm_addr(vlan_dev, 0, ip)) }
return 1;
} }
rcu_read_unlock();
return 0; return ret;
} }
/* /*
......
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