- Refuse hashsize of 0, since it is invalid.

- Use defined constant instead of 512.
This commit is contained in:
Gleb Smirnoff 2005-08-25 13:57:00 +00:00
parent 88cd456676
commit 360856f60e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149455

View file

@ -225,9 +225,9 @@ syncache_init(void)
&tcp_syncache.cache_limit);
TUNABLE_INT_FETCH("net.inet.tcp.syncache.bucketlimit",
&tcp_syncache.bucket_limit);
if (!powerof2(tcp_syncache.hashsize)) {
if (!powerof2(tcp_syncache.hashsize) || tcp_syncache.hashsize == 0) {
printf("WARNING: syncache hash size is not a power of 2.\n");
tcp_syncache.hashsize = 512; /* safe default */
tcp_syncache.hashsize = TCP_SYNCACHE_HASHSIZE;
}
tcp_syncache.hashmask = tcp_syncache.hashsize - 1;