mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Fixed the case where argument of 0.0.0.0/8 would match the default route.
This commit is contained in:
parent
3ea420e391
commit
ecfe112d3e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66448
@ -760,12 +760,12 @@ inet_makenetandmask(net, sin, bits)
|
||||
register char *cp;
|
||||
|
||||
rtm_addrs |= RTA_NETMASK;
|
||||
if (net == 0)
|
||||
mask = addr = 0;
|
||||
else if (bits) {
|
||||
if (bits) {
|
||||
addr = net;
|
||||
mask = 0xffffffff << (32 - bits);
|
||||
} else if (net < 128) {
|
||||
} else if (net == 0)
|
||||
mask = addr = 0;
|
||||
else if (net < 128) {
|
||||
addr = net << IN_CLASSA_NSHIFT;
|
||||
mask = IN_CLASSA_NET;
|
||||
} else if (net < 65536) {
|
||||
|
Loading…
Reference in New Issue
Block a user