Fix fallout from r243019, which broke parsing of shortened network
prefixes. Reported and tested by: delphij
This commit is contained in:
parent
5c9fa630f6
commit
7c283ae860
@ -1032,6 +1032,13 @@ inet_makenetandmask(u_long net, struct sockaddr_in *sin, u_long bits)
|
||||
|
||||
rtm_addrs |= RTA_NETMASK;
|
||||
|
||||
/*
|
||||
* MSB of net should be meaningful. 0/0 is exception.
|
||||
*/
|
||||
if (net > 0)
|
||||
while ((net & 0xff000000) == 0)
|
||||
net <<= 8;
|
||||
|
||||
/*
|
||||
* If no /xx was specified we must calculate the
|
||||
* CIDR address.
|
||||
|
Loading…
x
Reference in New Issue
Block a user