Interpret 'prefixlen 0' as the maximum prefix length, as ifconfig
has always done.
This commit is contained in:
parent
ed7181ed99
commit
e4942eb316
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: util.c,v 1.2 2008/05/06 16:09:18 dyoung Exp $ */
|
/* $NetBSD: util.c,v 1.3 2008/05/07 18:17:42 dyoung Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c)2008 David Young. All rights reserved.
|
* Copyright (c)2008 David Young. All rights reserved.
|
||||||
@ -175,6 +175,9 @@ prefixlen_to_mask(int af, int plen)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (plen == 0)
|
||||||
|
plen = addrlen * NBBY;
|
||||||
|
|
||||||
memset(addr, 0xff, (plen + NBBY - 1) / NBBY);
|
memset(addr, 0xff, (plen + NBBY - 1) / NBBY);
|
||||||
|
|
||||||
nbit = plen % NBBY;
|
nbit = plen % NBBY;
|
||||||
|
Loading…
Reference in New Issue
Block a user