mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 00:51:35 +00:00
inet: Sanitize inet{,6} protocol demux.
Don't pretend that inet_protos[] and inet6_protos[] are hashes, thay are just a straight arrays. Remove all unnecessary hash masking. Document MAX_INET_PROTOS. Use RAW_HTABLE_SIZE when appropriate. Reported-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
677a3d60fb
commit
f9242b6b28
9 changed files with 37 additions and 48 deletions
|
@ -29,8 +29,11 @@
|
|||
#include <linux/ipv6.h>
|
||||
#endif
|
||||
|
||||
#define MAX_INET_PROTOS 256 /* Must be a power of 2 */
|
||||
|
||||
/* This is one larger than the largest protocol value that can be
|
||||
* found in an ipv4 or ipv6 header. Since in both cases the protocol
|
||||
* value is presented in a __u8, this is defined to be 256.
|
||||
*/
|
||||
#define MAX_INET_PROTOS 256
|
||||
|
||||
/* This is used to register protocols. */
|
||||
struct net_protocol {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue