aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/reassembly.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-18 21:02:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-18 21:02:35 -0400
commit334d094504c2fe1c44211ecb49146ae6bca8c321 (patch)
treed3c0f68e4b9f8e3d2ccc39e7dfe5de0534a5fad9 /net/ipv6/reassembly.c
parentd1a4be630fb068f251d64b62919f143c49ca8057 (diff)
parentd1643d24c61b725bef399cc1cf2944b4c9c23177 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26: (1090 commits) [NET]: Fix and allocate less memory for ->priv'less netdevices [IPV6]: Fix dangling references on error in fib6_add(). [NETLABEL]: Fix NULL deref in netlbl_unlabel_staticlist_gen() if ifindex not found [PKT_SCHED]: Fix datalen check in tcf_simp_init(). [INET]: Uninline the __inet_inherit_port call. [INET]: Drop the inet_inherit_port() call. SCTP: Initialize partial_bytes_acked to 0, when all of the data is acked. [netdrvr] forcedeth: internal simplifications; changelog removal phylib: factor out get_phy_id from within get_phy_device PHY: add BCM5464 support to broadcom PHY driver cxgb3: Fix __must_check warning with dev_dbg. tc35815: Statistics cleanup natsemi: fix MMIO for PPC 44x platforms [TIPC]: Cleanup of TIPC reference table code [TIPC]: Optimized initialization of TIPC reference table [TIPC]: Remove inlining of reference table locking routines e1000: convert uint16_t style integers to u16 ixgb: convert uint16_t style integers to u16 sb1000.c: make const arrays static sb1000.c: stop inlining largish static functions ...
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r--net/ipv6/reassembly.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index f936d045a39d..7b247e3a16fe 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -202,7 +202,7 @@ static void ip6_frag_expire(unsigned long data)
202 202
203 spin_lock(&fq->q.lock); 203 spin_lock(&fq->q.lock);
204 204
205 if (fq->q.last_in & COMPLETE) 205 if (fq->q.last_in & INET_FRAG_COMPLETE)
206 goto out; 206 goto out;
207 207
208 fq_kill(fq); 208 fq_kill(fq);
@@ -217,7 +217,7 @@ static void ip6_frag_expire(unsigned long data)
217 rcu_read_unlock(); 217 rcu_read_unlock();
218 218
219 /* Don't send error if the first segment did not arrive. */ 219 /* Don't send error if the first segment did not arrive. */
220 if (!(fq->q.last_in&FIRST_IN) || !fq->q.fragments) 220 if (!(fq->q.last_in & INET_FRAG_FIRST_IN) || !fq->q.fragments)
221 goto out; 221 goto out;
222 222
223 /* 223 /*
@@ -265,7 +265,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
265 struct net_device *dev; 265 struct net_device *dev;
266 int offset, end; 266 int offset, end;
267 267
268 if (fq->q.last_in & COMPLETE) 268 if (fq->q.last_in & INET_FRAG_COMPLETE)
269 goto err; 269 goto err;
270 270
271 offset = ntohs(fhdr->frag_off) & ~0x7; 271 offset = ntohs(fhdr->frag_off) & ~0x7;
@@ -294,9 +294,9 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
294 * or have different end, the segment is corrupted. 294 * or have different end, the segment is corrupted.
295 */ 295 */
296 if (end < fq->q.len || 296 if (end < fq->q.len ||
297 ((fq->q.last_in & LAST_IN) && end != fq->q.len)) 297 ((fq->q.last_in & INET_FRAG_LAST_IN) && end != fq->q.len))
298 goto err; 298 goto err;
299 fq->q.last_in |= LAST_IN; 299 fq->q.last_in |= INET_FRAG_LAST_IN;
300 fq->q.len = end; 300 fq->q.len = end;
301 } else { 301 } else {
302 /* Check if the fragment is rounded to 8 bytes. 302 /* Check if the fragment is rounded to 8 bytes.
@@ -314,7 +314,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
314 } 314 }
315 if (end > fq->q.len) { 315 if (end > fq->q.len) {
316 /* Some bits beyond end -> corruption. */ 316 /* Some bits beyond end -> corruption. */
317 if (fq->q.last_in & LAST_IN) 317 if (fq->q.last_in & INET_FRAG_LAST_IN)
318 goto err; 318 goto err;
319 fq->q.len = end; 319 fq->q.len = end;
320 } 320 }
@@ -417,10 +417,11 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
417 */ 417 */
418 if (offset == 0) { 418 if (offset == 0) {
419 fq->nhoffset = nhoff; 419 fq->nhoffset = nhoff;
420 fq->q.last_in |= FIRST_IN; 420 fq->q.last_in |= INET_FRAG_FIRST_IN;
421 } 421 }
422 422
423 if (fq->q.last_in == (FIRST_IN | LAST_IN) && fq->q.meat == fq->q.len) 423 if (fq->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
424 fq->q.meat == fq->q.len)
424 return ip6_frag_reasm(fq, prev, dev); 425 return ip6_frag_reasm(fq, prev, dev);
425 426
426 write_lock(&ip6_frags.lock); 427 write_lock(&ip6_frags.lock);
@@ -600,7 +601,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
600 return 1; 601 return 1;
601 } 602 }
602 603
603 net = skb->dev->nd_net; 604 net = dev_net(skb->dev);
604 if (atomic_read(&net->ipv6.frags.mem) > net->ipv6.frags.high_thresh) 605 if (atomic_read(&net->ipv6.frags.mem) > net->ipv6.frags.high_thresh)
605 ip6_evictor(net, ip6_dst_idev(skb->dst)); 606 ip6_evictor(net, ip6_dst_idev(skb->dst));
606 607