diff options
author | ru <ru@FreeBSD.org> | 2011-03-01 11:47:16 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2011-03-01 11:47:16 +0000 |
commit | 9bdd2cd5a9bae82e8ae3ec5c085e4d4531aa22f7 (patch) | |
tree | 00f196adc9c36efe9bd8b9850ab04ff10c72cf51 | |
parent | 3bd182f4eb0bc70fc8787856b669e6ef98e158b9 (diff) | |
download | FreeBSD-src-9bdd2cd5a9bae82e8ae3ec5c085e4d4531aa22f7.zip FreeBSD-src-9bdd2cd5a9bae82e8ae3ec5c085e4d4531aa22f7.tar.gz |
Fixed conversion of prefix length to a netmask.
-rw-r--r-- | usr.sbin/mountd/mountd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 1b98c7d..ac52154 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -2875,7 +2875,7 @@ makemask(struct sockaddr_storage *ssp, int bitlen) for (i = 0; i < len; i++) { bits = (bitlen > CHAR_BIT) ? CHAR_BIT : bitlen; - *p++ = (1 << bits) - 1; + *p++ = (u_char)~0 << (CHAR_BIT - bits); bitlen -= bits; } return 0; |