Skip to content

Commit 90fb625

Browse files
nikolay@redhat.comdavem330
authored andcommitted
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>
1 parent fbb0c41 commit 90fb625

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4670,12 +4670,13 @@ static int bond_check_params(struct bond_params *params)
46704670
arp_ip_count++) {
46714671
/* not complete check, but should be good enough to
46724672
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)) {
46744676
pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
46754677
arp_ip_target[arp_ip_count]);
46764678
arp_interval = 0;
46774679
} else {
4678-
__be32 ip = in_aton(arp_ip_target[arp_ip_count]);
46794680
arp_target[arp_ip_count] = ip;
46804681
}
46814682
}

0 commit comments

Comments
 (0)