Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276263
b: refs/heads/master
c: 917fbdb
h: refs/heads/master
i:
  276261: 03d25d3
  276259: afd40b0
  276255: 06e3f0b
v: v3
  • Loading branch information
Henrik Saavedra Persson authored and David S. Miller committed Dec 1, 2011
1 parent 5d55821 commit 08d5bb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 218fa90f072e4aeff9003d57e390857f4f35513e
refs/heads/master: 917fbdb32f37e9a93b00bb12ee83532982982df3
33 changes: 6 additions & 27 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2553,30 +2553,6 @@ void bond_mii_monitor(struct work_struct *work)
}
}

static __be32 bond_glean_dev_ip(struct net_device *dev)
{
struct in_device *idev;
struct in_ifaddr *ifa;
__be32 addr = 0;

if (!dev)
return 0;

rcu_read_lock();
idev = __in_dev_get_rcu(dev);
if (!idev)
goto out;

ifa = idev->ifa_list;
if (!ifa)
goto out;

addr = ifa->ifa_local;
out:
rcu_read_unlock();
return addr;
}

static int bond_has_this_ip(struct bonding *bond, __be32 ip)
{
struct vlan_entry *vlan;
Expand Down Expand Up @@ -3322,14 +3298,18 @@ static int bond_inetaddr_event(struct notifier_block *this, unsigned long event,
struct bonding *bond;
struct vlan_entry *vlan;

/* we only care about primary address */
if(ifa->ifa_flags & IFA_F_SECONDARY)
return NOTIFY_DONE;

list_for_each_entry(bond, &bn->dev_list, bond_list) {
if (bond->dev == event_dev) {
switch (event) {
case NETDEV_UP:
bond->master_ip = ifa->ifa_local;
return NOTIFY_OK;
case NETDEV_DOWN:
bond->master_ip = bond_glean_dev_ip(bond->dev);
bond->master_ip = 0;
return NOTIFY_OK;
default:
return NOTIFY_DONE;
Expand All @@ -3345,8 +3325,7 @@ static int bond_inetaddr_event(struct notifier_block *this, unsigned long event,
vlan->vlan_ip = ifa->ifa_local;
return NOTIFY_OK;
case NETDEV_DOWN:
vlan->vlan_ip =
bond_glean_dev_ip(vlan_dev);
vlan->vlan_ip = 0;
return NOTIFY_OK;
default:
return NOTIFY_DONE;
Expand Down

0 comments on commit 08d5bb3

Please sign in to comment.