aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/reassembly.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r--net/ipv6/reassembly.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 64cfef1b0a4c..7b954e2539d0 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -104,26 +104,22 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
104unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr, 104unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr,
105 const struct in6_addr *daddr, u32 rnd) 105 const struct in6_addr *daddr, u32 rnd)
106{ 106{
107 u32 a, b, c; 107 u32 c;
108 108
109 a = (__force u32)saddr->s6_addr32[0]; 109 c = jhash_3words((__force u32)saddr->s6_addr32[0],
110 b = (__force u32)saddr->s6_addr32[1]; 110 (__force u32)saddr->s6_addr32[1],
111 c = (__force u32)saddr->s6_addr32[2]; 111 (__force u32)saddr->s6_addr32[2],
112 rnd);
112 113
113 a += JHASH_GOLDEN_RATIO; 114 c = jhash_3words((__force u32)saddr->s6_addr32[3],
114 b += JHASH_GOLDEN_RATIO; 115 (__force u32)daddr->s6_addr32[0],
115 c += rnd; 116 (__force u32)daddr->s6_addr32[1],
116 __jhash_mix(a, b, c); 117 c);
117 118
118 a += (__force u32)saddr->s6_addr32[3]; 119 c = jhash_3words((__force u32)daddr->s6_addr32[2],
119 b += (__force u32)daddr->s6_addr32[0]; 120 (__force u32)daddr->s6_addr32[3],
120 c += (__force u32)daddr->s6_addr32[1]; 121 (__force u32)id,
121 __jhash_mix(a, b, c); 122 c);
122
123 a += (__force u32)daddr->s6_addr32[2];
124 b += (__force u32)daddr->s6_addr32[3];
125 c += (__force u32)id;
126 __jhash_mix(a, b, c);
127 123
128 return c & (INETFRAGS_HASHSZ - 1); 124 return c & (INETFRAGS_HASHSZ - 1);
129} 125}
@@ -228,7 +224,7 @@ out:
228} 224}
229 225
230static __inline__ struct frag_queue * 226static __inline__ struct frag_queue *
231fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst) 227fq_find(struct net *net, __be32 id, const struct in6_addr *src, const struct in6_addr *dst)
232{ 228{
233 struct inet_frag_queue *q; 229 struct inet_frag_queue *q;
234 struct ip6_create_arg arg; 230 struct ip6_create_arg arg;
@@ -349,7 +345,7 @@ found:
349 345
350 /* Check for overlap with preceding fragment. */ 346 /* Check for overlap with preceding fragment. */
351 if (prev && 347 if (prev &&
352 (FRAG6_CB(prev)->offset + prev->len) - offset > 0) 348 (FRAG6_CB(prev)->offset + prev->len) > offset)
353 goto discard_fq; 349 goto discard_fq;
354 350
355 /* Look for overlap with succeeding segment. */ 351 /* Look for overlap with succeeding segment. */
@@ -458,7 +454,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
458 /* If the first fragment is fragmented itself, we split 454 /* If the first fragment is fragmented itself, we split
459 * it to two chunks: the first with data and paged part 455 * it to two chunks: the first with data and paged part
460 * and the second, holding only fragments. */ 456 * and the second, holding only fragments. */
461 if (skb_has_frags(head)) { 457 if (skb_has_frag_list(head)) {
462 struct sk_buff *clone; 458 struct sk_buff *clone;
463 int i, plen = 0; 459 int i, plen = 0;
464 460
@@ -539,7 +535,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
539{ 535{
540 struct frag_hdr *fhdr; 536 struct frag_hdr *fhdr;
541 struct frag_queue *fq; 537 struct frag_queue *fq;
542 struct ipv6hdr *hdr = ipv6_hdr(skb); 538 const struct ipv6hdr *hdr = ipv6_hdr(skb);
543 struct net *net = dev_net(skb_dst(skb)->dev); 539 struct net *net = dev_net(skb_dst(skb)->dev);
544 540
545 IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMREQDS); 541 IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMREQDS);