aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJay Vosburgh <fubar@us.ibm.com>2008-05-18 00:10:08 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-05-22 06:34:18 -0400
commit4b8a9239ee708958ed72722a0e5e0cf34243ad26 (patch)
tree6ec9644e7426d8c23508cb0924dfc71e1474426b /drivers/net
parent5ce0da8f0386b62345312ec8fed31303732f4220 (diff)
bonding: remove test for IP in ARP monitor
Remove bond_has_ip and all references to it. With this change, the ARP monitor will always send ARP probes if the master is up and has at least one slave. If the bond has an IP address, it is used in the ARP probe; if not, the probes are sent with all zeros in the sender's IP address (which is consistent with an RFC 2131 4.4.1 duplicate address probe). This is useful for cases when bonding itself is hidden underneath a layer of virtual devices, e.g., with Xen. Change suggested by Tsutomu Fujii <t-fujii@nb.jp.nec.com>, who included a one-line patch that only affected active-backup mode. Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_main.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 12c71582f4f6..e3da1e53b9ce 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2426,25 +2426,6 @@ out:
2426 return addr; 2426 return addr;
2427} 2427}
2428 2428
2429static int bond_has_ip(struct bonding *bond)
2430{
2431 struct vlan_entry *vlan, *vlan_next;
2432
2433 if (bond->master_ip)
2434 return 1;
2435
2436 if (list_empty(&bond->vlan_list))
2437 return 0;
2438
2439 list_for_each_entry_safe(vlan, vlan_next, &bond->vlan_list,
2440 vlan_list) {
2441 if (vlan->vlan_ip)
2442 return 1;
2443 }
2444
2445 return 0;
2446}
2447
2448static int bond_has_this_ip(struct bonding *bond, __be32 ip) 2429static int bond_has_this_ip(struct bonding *bond, __be32 ip)
2449{ 2430{
2450 struct vlan_entry *vlan, *vlan_next; 2431 struct vlan_entry *vlan, *vlan_next;
@@ -2764,8 +2745,7 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
2764 * if we don't know our ip yet 2745 * if we don't know our ip yet
2765 */ 2746 */
2766 if (time_after_eq(jiffies, slave->dev->trans_start + 2*delta_in_ticks) || 2747 if (time_after_eq(jiffies, slave->dev->trans_start + 2*delta_in_ticks) ||
2767 (time_after_eq(jiffies, slave->dev->last_rx + 2*delta_in_ticks) && 2748 (time_after_eq(jiffies, slave->dev->last_rx + 2*delta_in_ticks))) {
2768 bond_has_ip(bond))) {
2769 2749
2770 slave->link = BOND_LINK_DOWN; 2750 slave->link = BOND_LINK_DOWN;
2771 slave->state = BOND_STATE_BACKUP; 2751 slave->state = BOND_STATE_BACKUP;
@@ -2900,8 +2880,7 @@ void bond_activebackup_arp_mon(struct work_struct *work)
2900 2880
2901 if ((slave != bond->curr_active_slave) && 2881 if ((slave != bond->curr_active_slave) &&
2902 (!bond->current_arp_slave) && 2882 (!bond->current_arp_slave) &&
2903 (time_after_eq(jiffies, slave_last_rx(bond, slave) + 3*delta_in_ticks) && 2883 (time_after_eq(jiffies, slave_last_rx(bond, slave) + 3*delta_in_ticks))) {
2904 bond_has_ip(bond))) {
2905 /* a backup slave has gone down; three times 2884 /* a backup slave has gone down; three times
2906 * the delta allows the current slave to be 2885 * the delta allows the current slave to be
2907 * taken out before the backup slave. 2886 * taken out before the backup slave.
@@ -2947,8 +2926,7 @@ void bond_activebackup_arp_mon(struct work_struct *work)
2947 * if it is up and needs to take over as the curr_active_slave 2926 * if it is up and needs to take over as the curr_active_slave
2948 */ 2927 */
2949 if ((time_after_eq(jiffies, slave->dev->trans_start + 2*delta_in_ticks) || 2928 if ((time_after_eq(jiffies, slave->dev->trans_start + 2*delta_in_ticks) ||
2950 (time_after_eq(jiffies, slave_last_rx(bond, slave) + 2*delta_in_ticks) && 2929 (time_after_eq(jiffies, slave_last_rx(bond, slave) + 2*delta_in_ticks))) &&
2951 bond_has_ip(bond))) &&
2952 time_after_eq(jiffies, slave->jiffies + 2*delta_in_ticks)) { 2930 time_after_eq(jiffies, slave->jiffies + 2*delta_in_ticks)) {
2953 2931
2954 slave->link = BOND_LINK_DOWN; 2932 slave->link = BOND_LINK_DOWN;
@@ -3000,9 +2978,8 @@ void bond_activebackup_arp_mon(struct work_struct *work)
3000 /* the current slave must tx an arp to ensure backup slaves 2978 /* the current slave must tx an arp to ensure backup slaves
3001 * rx traffic 2979 * rx traffic
3002 */ 2980 */
3003 if (slave && bond_has_ip(bond)) { 2981 if (slave && IS_UP(slave->dev))
3004 bond_arp_send_all(bond, slave); 2982 bond_arp_send_all(bond, slave);
3005 }
3006 } 2983 }
3007 2984
3008 /* if we don't have a curr_active_slave, search for the next available 2985 /* if we don't have a curr_active_slave, search for the next available