bonding: don't add duplicate targets to arp_ip_target
authorVeaceslav Falico <vfalico@redhat.com>
Mon, 24 Jun 2013 09:49:30 +0000 (11:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Jun 2013 23:58:38 +0000 (16:58 -0700)
Print a warning and skip them.

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c

index 976d28e..1645130 100644 (file)
@@ -4588,7 +4588,11 @@ static int bond_check_params(struct bond_params *params)
                                   arp_ip_target[i]);
                        arp_interval = 0;
                } else {
-                       arp_target[arp_ip_count++] = ip;
+                       if (bond_get_targets_ip(arp_target, ip) == -1)
+                               arp_target[arp_ip_count++] = ip;
+                       else
+                               pr_warning("Warning: duplicate address %pI4 in arp_ip_target, skipping\n",
+                                          &ip);
                }
        }