aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip.h
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2015-03-25 12:07:44 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-25 14:07:04 -0400
commitb6a7719aedd7e5c0f2df7641aa47386111682df4 (patch)
treef0374d5535a6670c1cb453cc6c0e15237e108376 /include/net/ip.h
parent8fa38a38ac37a0ca5366cd62ba4339c2bab49db9 (diff)
ipv4: hash net ptr into fragmentation bucket selection
As namespaces are sometimes used with overlapping ip address ranges, we should also use the namespace as input to the hash to select the ip fragmentation counter bucket. Cc: Eric Dumazet <edumazet@google.com> Cc: Flavio Leitner <fbl@redhat.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip.h')
-rw-r--r--include/net/ip.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 025c61c0dffb..d0808a323763 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -318,9 +318,10 @@ static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb)
318} 318}
319 319
320u32 ip_idents_reserve(u32 hash, int segs); 320u32 ip_idents_reserve(u32 hash, int segs);
321void __ip_select_ident(struct iphdr *iph, int segs); 321void __ip_select_ident(struct net *net, struct iphdr *iph, int segs);
322 322
323static inline void ip_select_ident_segs(struct sk_buff *skb, struct sock *sk, int segs) 323static inline void ip_select_ident_segs(struct net *net, struct sk_buff *skb,
324 struct sock *sk, int segs)
324{ 325{
325 struct iphdr *iph = ip_hdr(skb); 326 struct iphdr *iph = ip_hdr(skb);
326 327
@@ -337,13 +338,14 @@ static inline void ip_select_ident_segs(struct sk_buff *skb, struct sock *sk, in
337 iph->id = 0; 338 iph->id = 0;
338 } 339 }
339 } else { 340 } else {
340 __ip_select_ident(iph, segs); 341 __ip_select_ident(net, iph, segs);
341 } 342 }
342} 343}
343 344
344static inline void ip_select_ident(struct sk_buff *skb, struct sock *sk) 345static inline void ip_select_ident(struct net *net, struct sk_buff *skb,
346 struct sock *sk)
345{ 347{
346 ip_select_ident_segs(skb, sk, 1); 348 ip_select_ident_segs(net, skb, sk, 1);
347} 349}
348 350
349static inline __wsum inet_compute_pseudo(struct sk_buff *skb, int proto) 351static inline __wsum inet_compute_pseudo(struct sk_buff *skb, int proto)