lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150831.151600.1336251424367446992.davem@davemloft.net>
Date:	Mon, 31 Aug 2015 15:16:00 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	lucien.xin@...il.com
Cc:	netdev@...r.kernel.org, mleitner@...hat.com, vyasevic@...hat.com,
	daniel@...earbox.net
Subject: Re: [PATCH net] sctp: support global vtag assochash and per
 endpoint s(d)port assochash table

From: Xin Long <lucien.xin@...il.com>
Date: Tue,  1 Sep 2015 01:44:28 +0800

> @@ -524,18 +524,16 @@ static inline int sctp_assoc_hashfn(struct net *net, __u16 lport, __u16 rport)
>  {
>  	int h = (lport << 16) + rport + net_hash_mix(net);
>  	h ^= h>>8;
> -	return h & (sctp_assoc_hashsize - 1);
> +	return h & (256 - 1);

It is not acceptable to use a magic constant for the hash table size.
You need to define this using a macro and use it consistently.

Furthermore, you should be looking into dynamically sized
hash tables because not everyone will need this many entries.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ