diff options
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r-- | include/net/ipv6.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 221238254eb7..8606c9113d3f 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <net/flow.h> | 22 | #include <net/flow.h> |
23 | #include <net/flow_dissector.h> | 23 | #include <net/flow_dissector.h> |
24 | #include <net/snmp.h> | 24 | #include <net/snmp.h> |
25 | #include <net/netns/hash.h> | ||
25 | 26 | ||
26 | #define SIN6_LEN_RFC2133 24 | 27 | #define SIN6_LEN_RFC2133 24 |
27 | 28 | ||
@@ -674,6 +675,22 @@ static inline bool ipv6_addr_v4mapped(const struct in6_addr *a) | |||
674 | cpu_to_be32(0x0000ffff))) == 0UL; | 675 | cpu_to_be32(0x0000ffff))) == 0UL; |
675 | } | 676 | } |
676 | 677 | ||
678 | static inline u32 ipv6_portaddr_hash(const struct net *net, | ||
679 | const struct in6_addr *addr6, | ||
680 | unsigned int port) | ||
681 | { | ||
682 | unsigned int hash, mix = net_hash_mix(net); | ||
683 | |||
684 | if (ipv6_addr_any(addr6)) | ||
685 | hash = jhash_1word(0, mix); | ||
686 | else if (ipv6_addr_v4mapped(addr6)) | ||
687 | hash = jhash_1word((__force u32)addr6->s6_addr32[3], mix); | ||
688 | else | ||
689 | hash = jhash2((__force u32 *)addr6->s6_addr32, 4, mix); | ||
690 | |||
691 | return hash ^ port; | ||
692 | } | ||
693 | |||
677 | /* | 694 | /* |
678 | * Check for a RFC 4843 ORCHID address | 695 | * Check for a RFC 4843 ORCHID address |
679 | * (Overlay Routable Cryptographic Hash Identifiers) | 696 | * (Overlay Routable Cryptographic Hash Identifiers) |
@@ -953,6 +970,8 @@ static inline struct sk_buff *ip6_finish_skb(struct sock *sk) | |||
953 | &inet6_sk(sk)->cork); | 970 | &inet6_sk(sk)->cork); |
954 | } | 971 | } |
955 | 972 | ||
973 | unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst); | ||
974 | |||
956 | int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst, | 975 | int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst, |
957 | struct flowi6 *fl6); | 976 | struct flowi6 *fl6); |
958 | struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6, | 977 | struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6, |