diff options
author | msmith <msmith@FreeBSD.org> | 1999-02-04 03:02:56 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1999-02-04 03:02:56 +0000 |
commit | 8ec612746809f0eefd72a3856422964c21388e04 (patch) | |
tree | c29a56e91f356845ad1de3ab52018f4e43792fcf /sys/netinet/tcp_subr.c | |
parent | 58870eb89b28faf782baefdece2381c6b431c429 (diff) | |
download | FreeBSD-src-8ec612746809f0eefd72a3856422964c21388e04.zip FreeBSD-src-8ec612746809f0eefd72a3856422964c21388e04.tar.gz |
Fix power-of-2 check for the TCB hash size.
Submitted by: Brian Feldman <green@unixhelp.org>
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 9063c86..49c1709 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 - * $Id: tcp_subr.c,v 1.49 1998/12/07 21:58:42 archie Exp $ + * $Id: tcp_subr.c,v 1.50 1999/02/03 08:59:30 msmith Exp $ */ #include "opt_compat.h" @@ -136,7 +136,7 @@ tcp_init() tcbinfo.listhead = &tcb; if (!(getenv_int("net.inet.tcp.tcbhashsize", &hashsize))) hashsize = TCBHASHSIZE; - if ((1 << ffs(hashsize)) != hashsize) { + if ((1 << (ffs(hashsize) - 1)) != hashsize) { printf("WARNING: TCB hash size not a power of 2\n"); hashsize = 512; /* safe default */ } |