diff options
Diffstat (limited to 'include/net/ip.h')
-rw-r--r-- | include/net/ip.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index af8addbaa3c1..746abff9ce51 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -26,12 +26,14 @@ | |||
26 | #include <linux/ip.h> | 26 | #include <linux/ip.h> |
27 | #include <linux/in.h> | 27 | #include <linux/in.h> |
28 | #include <linux/skbuff.h> | 28 | #include <linux/skbuff.h> |
29 | #include <linux/jhash.h> | ||
29 | 30 | ||
30 | #include <net/inet_sock.h> | 31 | #include <net/inet_sock.h> |
31 | #include <net/route.h> | 32 | #include <net/route.h> |
32 | #include <net/snmp.h> | 33 | #include <net/snmp.h> |
33 | #include <net/flow.h> | 34 | #include <net/flow.h> |
34 | #include <net/flow_dissector.h> | 35 | #include <net/flow_dissector.h> |
36 | #include <net/netns/hash.h> | ||
35 | 37 | ||
36 | #define IPV4_MAX_PMTU 65535U /* RFC 2675, Section 5.1 */ | 38 | #define IPV4_MAX_PMTU 65535U /* RFC 2675, Section 5.1 */ |
37 | #define IPV4_MIN_MTU 68 /* RFC 791 */ | 39 | #define IPV4_MIN_MTU 68 /* RFC 791 */ |
@@ -522,6 +524,13 @@ static inline unsigned int ipv4_addr_hash(__be32 ip) | |||
522 | return (__force unsigned int) ip; | 524 | return (__force unsigned int) ip; |
523 | } | 525 | } |
524 | 526 | ||
527 | static inline u32 ipv4_portaddr_hash(const struct net *net, | ||
528 | __be32 saddr, | ||
529 | unsigned int port) | ||
530 | { | ||
531 | return jhash_1word((__force u32)saddr, net_hash_mix(net)) ^ port; | ||
532 | } | ||
533 | |||
525 | bool ip_call_ra_chain(struct sk_buff *skb); | 534 | bool ip_call_ra_chain(struct sk_buff *skb); |
526 | 535 | ||
527 | /* | 536 | /* |