aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorBrian Haley <brian.haley@hp.com>2009-04-13 03:11:30 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-13 03:12:41 -0400
commit5a31bec014449dc9ca994e4c1dbf2802b7ca458a (patch)
tree53bacdda4c451bc8ed59bbd0f43e8f466ff93759 /drivers/net/bonding/bond_main.c
parent9ca046d57412361ac4d220b96fed7fb932616d85 (diff)
Bonding: fix zero address hole bug in arp_ip_target list
Fix a zero address hole bug in the bonding arp_ip_target list that was causing the bond to ignore ARP replies (bugz 13006). Instead of just setting the array entry to zero, we now copy any additional entries down one slot, putting the zero entry at the end. With this change we can now have all the loops that walk the array stop when they hit a zero since there will be no addresses after it. Changes are based in part on code fragment provided in kernel: bugzilla 13006: http://bugzilla.kernel.org/show_bug.cgi?id=13006 by Steve Howard <steve@astutenetworks.com> Signed-off-by: Brian Haley <brian.haley@hp.com> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 99610f358c40..63369b6b14d4 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2570,7 +2570,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2570 2570
2571 for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { 2571 for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) {
2572 if (!targets[i]) 2572 if (!targets[i])
2573 continue; 2573 break;
2574 pr_debug("basa: target %x\n", targets[i]); 2574 pr_debug("basa: target %x\n", targets[i]);
2575 if (list_empty(&bond->vlan_list)) { 2575 if (list_empty(&bond->vlan_list)) {
2576 pr_debug("basa: empty vlan: arp_send\n"); 2576 pr_debug("basa: empty vlan: arp_send\n");
@@ -2677,7 +2677,6 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
2677 int i; 2677 int i;
2678 __be32 *targets = bond->params.arp_targets; 2678 __be32 *targets = bond->params.arp_targets;
2679 2679
2680 targets = bond->params.arp_targets;
2681 for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) { 2680 for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) {
2682 pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n", 2681 pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n",
2683 &sip, &tip, i, &targets[i], bond_has_this_ip(bond, tip)); 2682 &sip, &tip, i, &targets[i], bond_has_this_ip(bond, tip));
@@ -3303,7 +3302,7 @@ static void bond_info_show_master(struct seq_file *seq)
3303 3302
3304 for(i = 0; (i < BOND_MAX_ARP_TARGETS) ;i++) { 3303 for(i = 0; (i < BOND_MAX_ARP_TARGETS) ;i++) {
3305 if (!bond->params.arp_targets[i]) 3304 if (!bond->params.arp_targets[i])
3306 continue; 3305 break;
3307 if (printed) 3306 if (printed)
3308 seq_printf(seq, ","); 3307 seq_printf(seq, ",");
3309 seq_printf(seq, " %pI4", &bond->params.arp_targets[i]); 3308 seq_printf(seq, " %pI4", &bond->params.arp_targets[i]);