Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[sfrench/cifs-2.6.git] / include / net / ipv6.h
index 221238254eb7837a1b57c6313b7a8f8fa83c0040..8606c9113d3f0870d84d8f8cdfc279f6d7033bd5 100644 (file)
@@ -22,6 +22,7 @@
 #include <net/flow.h>
 #include <net/flow_dissector.h>
 #include <net/snmp.h>
+#include <net/netns/hash.h>
 
 #define SIN6_LEN_RFC2133       24
 
@@ -674,6 +675,22 @@ static inline bool ipv6_addr_v4mapped(const struct in6_addr *a)
                                        cpu_to_be32(0x0000ffff))) == 0UL;
 }
 
+static inline u32 ipv6_portaddr_hash(const struct net *net,
+                                    const struct in6_addr *addr6,
+                                    unsigned int port)
+{
+       unsigned int hash, mix = net_hash_mix(net);
+
+       if (ipv6_addr_any(addr6))
+               hash = jhash_1word(0, mix);
+       else if (ipv6_addr_v4mapped(addr6))
+               hash = jhash_1word((__force u32)addr6->s6_addr32[3], mix);
+       else
+               hash = jhash2((__force u32 *)addr6->s6_addr32, 4, mix);
+
+       return hash ^ port;
+}
+
 /*
  * Check for a RFC 4843 ORCHID address
  * (Overlay Routable Cryptographic Hash Identifiers)
@@ -953,6 +970,8 @@ static inline struct sk_buff *ip6_finish_skb(struct sock *sk)
                              &inet6_sk(sk)->cork);
 }
 
+unsigned int ip6_dst_mtu_forward(const struct dst_entry *dst);
+
 int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst,
                   struct flowi6 *fl6);
 struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,