Fixed the case where argument of 0.0.0.0/8 would match the default route.

This commit is contained in:
Ruslan Ermilov 2000-09-29 10:37:16 +00:00
parent 3ea420e391
commit ecfe112d3e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66448

View file

@ -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) {