diff options
author | nikolay@redhat.com <nikolay@redhat.com> | 2012-11-28 20:34:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-29 13:13:15 -0500 |
commit | 90fb6250c509cabd425b7ae4524053dba2e27e2c (patch) | |
tree | d8b5740916d8a3ba304fdffc347d029e132baa14 /drivers/net | |
parent | fbb0c41b814d497c656fc7be9e35456f139cb2fb (diff) |
bonding: make arp_ip_target parameter checks consistent with sysfs
The module can be loaded with arp_ip_target="255.255.255.255" which makes
it impossible to remove as the function in sysfs checks for that value,
so we make the parameter checks consistent with sysfs.
v2: Fix formatting
v3: Make description text < 75 columns
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 1445c7ddb26c..a7d47350ea4b 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4670,12 +4670,13 @@ static int bond_check_params(struct bond_params *params) | |||
4670 | arp_ip_count++) { | 4670 | arp_ip_count++) { |
4671 | /* not complete check, but should be good enough to | 4671 | /* not complete check, but should be good enough to |
4672 | catch mistakes */ | 4672 | catch mistakes */ |
4673 | if (!isdigit(arp_ip_target[arp_ip_count][0])) { | 4673 | __be32 ip = in_aton(arp_ip_target[arp_ip_count]); |
4674 | if (!isdigit(arp_ip_target[arp_ip_count][0]) || | ||
4675 | ip == 0 || ip == htonl(INADDR_BROADCAST)) { | ||
4674 | pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n", | 4676 | pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n", |
4675 | arp_ip_target[arp_ip_count]); | 4677 | arp_ip_target[arp_ip_count]); |
4676 | arp_interval = 0; | 4678 | arp_interval = 0; |
4677 | } else { | 4679 | } else { |
4678 | __be32 ip = in_aton(arp_ip_target[arp_ip_count]); | ||
4679 | arp_target[arp_ip_count] = ip; | 4680 | arp_target[arp_ip_count] = ip; |
4680 | } | 4681 | } |
4681 | } | 4682 | } |