diff options
| author | Olof Johansson <olof@lixom.net> | 2011-12-15 22:02:34 -0800 | 
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2011-12-15 22:02:34 -0800 | 
| commit | 02735a29d8ce882ec698803f064e17888874780c (patch) | |
| tree | 6a4afa3bc8b6d4334df24910a56f77adf126b0c7 /drivers/net/bonding/bond_main.c | |
| parent | 8d685b7f4d9c9882442bf1b492558d5f17b694fa (diff) | |
| parent | 3d911ad22e8405c1a333a6812e405cb1a5ae9829 (diff) | |
| download | olio-linux-3.10-02735a29d8ce882ec698803f064e17888874780c.tar.xz olio-linux-3.10-02735a29d8ce882ec698803f064e17888874780c.zip  | |
Merge branch 'at91/defconfig' into next/cleanup
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
| -rw-r--r-- | drivers/net/bonding/bond_main.c | 33 | 
1 files changed, 6 insertions, 27 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index b0c57725648..7f8756825b8 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2553,30 +2553,6 @@ re_arm:  	}  } -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; @@ -3322,6 +3298,10 @@ 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) { @@ -3329,7 +3309,7 @@ static int bond_inetaddr_event(struct notifier_block *this, unsigned long event,  				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; @@ -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;  |