Patchwork [v2,net-next,2/6] bonding: don't add duplicate targets to arp_ip_target

login
register
mail settings
Submitter Veaceslav Falico
Date June 20, 2013, 4:35 p.m.
Message ID <1371746105-2482-3-git-send-email-vfalico@redhat.com>
Download mbox | patch
Permalink /patch/253030/
State Superseded
Delegated to: David Miller
Headers show

Comments

Veaceslav Falico - June 20, 2013, 4:35 p.m.
Print a warning and skip them.

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
 drivers/net/bonding/bond_main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 976d28e..1645130 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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);
 		}
 	}