diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-19 21:56:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-19 21:56:21 -0400 |
commit | f9242b6b28d61295f2bf7e8adfb1060b382e5381 (patch) | |
tree | b395670bd6ae832e9f6f87f47a1840baf3a06d0d /include/net | |
parent | 677a3d60fb3153f786a0d28fcf0287670e7bd3c2 (diff) |
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>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/protocol.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/net/protocol.h b/include/net/protocol.h index 875f4895b033..a1b1b530c338 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -29,8 +29,11 @@ | |||
29 | #include <linux/ipv6.h> | 29 | #include <linux/ipv6.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #define MAX_INET_PROTOS 256 /* Must be a power of 2 */ | 32 | /* This is one larger than the largest protocol value that can be |
33 | 33 | * found in an ipv4 or ipv6 header. Since in both cases the protocol | |
34 | * value is presented in a __u8, this is defined to be 256. | ||
35 | */ | ||
36 | #define MAX_INET_PROTOS 256 | ||
34 | 37 | ||
35 | /* This is used to register protocols. */ | 38 | /* This is used to register protocols. */ |
36 | struct net_protocol { | 39 | struct net_protocol { |