Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69315
b: refs/heads/master
c: 1053f62
h: refs/heads/master
i:
  69313: ea5a3c9
  69311: d999e62
v: v3
  • Loading branch information
Moni Shoua authored and Jeff Garzik committed Oct 15, 2007
1 parent 1230b1d commit 844fe12
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 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: 3158bf7d414b69fdc0c715d0a4d82e12b74ef974
refs/heads/master: 1053f62c24faa6d4ee6f5bfddeca847b84f67a95
24 changes: 21 additions & 3 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,8 +1103,14 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
if (new_active && !bond->do_set_mac_addr)
memcpy(bond->dev->dev_addr, new_active->dev->dev_addr,
new_active->dev->addr_len);

bond_send_gratuitous_arp(bond);
if (bond->curr_active_slave &&
test_bit(__LINK_STATE_LINKWATCH_PENDING,
&bond->curr_active_slave->dev->state)) {
dprintk("delaying gratuitous arp on %s\n",
bond->curr_active_slave->dev->name);
bond->send_grat_arp = 1;
} else
bond_send_gratuitous_arp(bond);
}
}

Expand Down Expand Up @@ -2073,6 +2079,17 @@ void bond_mii_monitor(struct net_device *bond_dev)
* program could monitor the link itself if needed.
*/

if (bond->send_grat_arp) {
if (bond->curr_active_slave && test_bit(__LINK_STATE_LINKWATCH_PENDING,
&bond->curr_active_slave->dev->state))
dprintk("Needs to send gratuitous arp but not yet\n");
else {
dprintk("sending delayed gratuitous arp on on %s\n",
bond->curr_active_slave->dev->name);
bond_send_gratuitous_arp(bond);
bond->send_grat_arp = 0;
}
}
read_lock(&bond->curr_slave_lock);
oldcurrent = bond->curr_active_slave;
read_unlock(&bond->curr_slave_lock);
Expand Down Expand Up @@ -2474,7 +2491,7 @@ static void bond_send_gratuitous_arp(struct bonding *bond)

if (bond->master_ip) {
bond_arp_send(slave->dev, ARPOP_REPLY, bond->master_ip,
bond->master_ip, 0);
bond->master_ip, 0);
}

list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
Expand Down Expand Up @@ -4280,6 +4297,7 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params)
bond->current_arp_slave = NULL;
bond->primary_slave = NULL;
bond->dev = bond_dev;
bond->send_grat_arp = 0;
INIT_LIST_HEAD(&bond->vlan_list);

/* Initialize the device entry points */
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/bonding/bonding.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ struct bonding {
struct timer_list arp_timer;
s8 kill_timers;
s8 do_set_mac_addr;
s8 send_grat_arp;
struct net_device_stats stats;
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc_entry;
Expand Down

0 comments on commit 844fe12

Please sign in to comment.