Commit 4b8a9239 authored by Jay Vosburgh's avatar Jay Vosburgh Committed by Jeff Garzik

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: default avatarJay Vosburgh <fubar@us.ibm.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 5ce0da8f
...@@ -2426,25 +2426,6 @@ static __be32 bond_glean_dev_ip(struct net_device *dev) ...@@ -2426,25 +2426,6 @@ static __be32 bond_glean_dev_ip(struct net_device *dev)
return addr; return addr;
} }
static int bond_has_ip(struct bonding *bond)
{
struct vlan_entry *vlan, *vlan_next;
if (bond->master_ip)
return 1;
if (list_empty(&bond->vlan_list))
return 0;
list_for_each_entry_safe(vlan, vlan_next, &bond->vlan_list,
vlan_list) {
if (vlan->vlan_ip)
return 1;
}
return 0;
}
static int bond_has_this_ip(struct bonding *bond, __be32 ip) static int bond_has_this_ip(struct bonding *bond, __be32 ip)
{ {
struct vlan_entry *vlan, *vlan_next; struct vlan_entry *vlan, *vlan_next;
...@@ -2764,8 +2745,7 @@ void bond_loadbalance_arp_mon(struct work_struct *work) ...@@ -2764,8 +2745,7 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
* if we don't know our ip yet * if we don't know our ip yet
*/ */
if (time_after_eq(jiffies, slave->dev->trans_start + 2*delta_in_ticks) || if (time_after_eq(jiffies, slave->dev->trans_start + 2*delta_in_ticks) ||
(time_after_eq(jiffies, slave->dev->last_rx + 2*delta_in_ticks) && (time_after_eq(jiffies, slave->dev->last_rx + 2*delta_in_ticks))) {
bond_has_ip(bond))) {
slave->link = BOND_LINK_DOWN; slave->link = BOND_LINK_DOWN;
slave->state = BOND_STATE_BACKUP; slave->state = BOND_STATE_BACKUP;
...@@ -2900,8 +2880,7 @@ void bond_activebackup_arp_mon(struct work_struct *work) ...@@ -2900,8 +2880,7 @@ void bond_activebackup_arp_mon(struct work_struct *work)
if ((slave != bond->curr_active_slave) && if ((slave != bond->curr_active_slave) &&
(!bond->current_arp_slave) && (!bond->current_arp_slave) &&
(time_after_eq(jiffies, slave_last_rx(bond, slave) + 3*delta_in_ticks) && (time_after_eq(jiffies, slave_last_rx(bond, slave) + 3*delta_in_ticks))) {
bond_has_ip(bond))) {
/* a backup slave has gone down; three times /* a backup slave has gone down; three times
* the delta allows the current slave to be * the delta allows the current slave to be
* taken out before the backup slave. * taken out before the backup slave.
...@@ -2947,8 +2926,7 @@ void bond_activebackup_arp_mon(struct work_struct *work) ...@@ -2947,8 +2926,7 @@ void bond_activebackup_arp_mon(struct work_struct *work)
* if it is up and needs to take over as the curr_active_slave * if it is up and needs to take over as the curr_active_slave
*/ */
if ((time_after_eq(jiffies, slave->dev->trans_start + 2*delta_in_ticks) || if ((time_after_eq(jiffies, slave->dev->trans_start + 2*delta_in_ticks) ||
(time_after_eq(jiffies, slave_last_rx(bond, slave) + 2*delta_in_ticks) && (time_after_eq(jiffies, slave_last_rx(bond, slave) + 2*delta_in_ticks))) &&
bond_has_ip(bond))) &&
time_after_eq(jiffies, slave->jiffies + 2*delta_in_ticks)) { time_after_eq(jiffies, slave->jiffies + 2*delta_in_ticks)) {
slave->link = BOND_LINK_DOWN; slave->link = BOND_LINK_DOWN;
...@@ -3000,9 +2978,8 @@ void bond_activebackup_arp_mon(struct work_struct *work) ...@@ -3000,9 +2978,8 @@ void bond_activebackup_arp_mon(struct work_struct *work)
/* the current slave must tx an arp to ensure backup slaves /* the current slave must tx an arp to ensure backup slaves
* rx traffic * rx traffic
*/ */
if (slave && bond_has_ip(bond)) { if (slave && IS_UP(slave->dev))
bond_arp_send_all(bond, slave); bond_arp_send_all(bond, slave);
}
} }
/* if we don't have a curr_active_slave, search for the next available /* if we don't have a curr_active_slave, search for the next available
......
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