aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index d4635987bda9..29b846cbfb48 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4471,7 +4471,7 @@ int bond_parse_parm(const char *buf, const struct bond_parm_tbl *tbl)
4471 4471
4472static int bond_check_params(struct bond_params *params) 4472static int bond_check_params(struct bond_params *params)
4473{ 4473{
4474 int arp_validate_value, fail_over_mac_value, primary_reselect_value; 4474 int arp_validate_value, fail_over_mac_value, primary_reselect_value, i;
4475 4475
4476 /* 4476 /*
4477 * Convert string parameters. 4477 * Convert string parameters.
@@ -4651,19 +4651,18 @@ static int bond_check_params(struct bond_params *params)
4651 arp_interval = BOND_LINK_ARP_INTERV; 4651 arp_interval = BOND_LINK_ARP_INTERV;
4652 } 4652 }
4653 4653
4654 for (arp_ip_count = 0; 4654 for (arp_ip_count = 0, i = 0;
4655 (arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[arp_ip_count]; 4655 (arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[i]; i++) {
4656 arp_ip_count++) {
4657 /* not complete check, but should be good enough to 4656 /* not complete check, but should be good enough to
4658 catch mistakes */ 4657 catch mistakes */
4659 __be32 ip = in_aton(arp_ip_target[arp_ip_count]); 4658 __be32 ip = in_aton(arp_ip_target[i]);
4660 if (!isdigit(arp_ip_target[arp_ip_count][0]) || 4659 if (!isdigit(arp_ip_target[i][0]) || ip == 0 ||
4661 ip == 0 || ip == htonl(INADDR_BROADCAST)) { 4660 ip == htonl(INADDR_BROADCAST)) {
4662 pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n", 4661 pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
4663 arp_ip_target[arp_ip_count]); 4662 arp_ip_target[i]);
4664 arp_interval = 0; 4663 arp_interval = 0;
4665 } else { 4664 } else {
4666 arp_target[arp_ip_count] = ip; 4665 arp_target[arp_ip_count++] = ip;
4667 } 4666 }
4668 } 4667 }
4669 4668
@@ -4697,8 +4696,6 @@ static int bond_check_params(struct bond_params *params)
4697 if (miimon) { 4696 if (miimon) {
4698 pr_info("MII link monitoring set to %d ms\n", miimon); 4697 pr_info("MII link monitoring set to %d ms\n", miimon);
4699 } else if (arp_interval) { 4698 } else if (arp_interval) {
4700 int i;
4701
4702 pr_info("ARP monitoring set to %d ms, validate %s, with %d target(s):", 4699 pr_info("ARP monitoring set to %d ms, validate %s, with %d target(s):",
4703 arp_interval, 4700 arp_interval,
4704 arp_validate_tbl[arp_validate_value].modename, 4701 arp_validate_tbl[arp_validate_value].modename,