Subject: [PATCH net-next 3/6] bonding: don't add duplicate targets to arp_ip_target

From: Veaceslav Falico <[email-masked]>
Date: Wed, 19 Jun 2013 19:34:43 +0200

Print a warning and skip them.

Signed-off-by: Veaceslav Falico <[email-masked]>
---
 drivers/net/bonding/bond_main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 09a79eb..b69c7f0 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4578,7 +4578,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);
 		}
 	}
 
-- 
1.7.1