aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/netfilter/nf_conntrack_reasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/netfilter/nf_conntrack_reasm.c')
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index d9c15402ba6..15ab1e3e8b5 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -311,7 +311,7 @@ static struct nf_ct_frag6_queue *nf_ct_frag6_intern(unsigned int hash,
311 write_lock(&nf_ct_frag6_lock); 311 write_lock(&nf_ct_frag6_lock);
312#ifdef CONFIG_SMP 312#ifdef CONFIG_SMP
313 hlist_for_each_entry(fq, n, &nf_ct_frag6_hash[hash], list) { 313 hlist_for_each_entry(fq, n, &nf_ct_frag6_hash[hash], list) {
314 if (fq->id == fq_in->id && 314 if (fq->id == fq_in->id &&
315 ipv6_addr_equal(&fq_in->saddr, &fq->saddr) && 315 ipv6_addr_equal(&fq_in->saddr, &fq->saddr) &&
316 ipv6_addr_equal(&fq_in->daddr, &fq->daddr)) { 316 ipv6_addr_equal(&fq_in->daddr, &fq->daddr)) {
317 atomic_inc(&fq->refcnt); 317 atomic_inc(&fq->refcnt);
@@ -374,7 +374,7 @@ fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst)
374 374
375 read_lock(&nf_ct_frag6_lock); 375 read_lock(&nf_ct_frag6_lock);
376 hlist_for_each_entry(fq, n, &nf_ct_frag6_hash[hash], list) { 376 hlist_for_each_entry(fq, n, &nf_ct_frag6_hash[hash], list) {
377 if (fq->id == id && 377 if (fq->id == id &&
378 ipv6_addr_equal(src, &fq->saddr) && 378 ipv6_addr_equal(src, &fq->saddr) &&
379 ipv6_addr_equal(dst, &fq->daddr)) { 379 ipv6_addr_equal(dst, &fq->daddr)) {
380 atomic_inc(&fq->refcnt); 380 atomic_inc(&fq->refcnt);
@@ -388,7 +388,7 @@ fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst)
388} 388}
389 389
390 390
391static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb, 391static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
392 struct frag_hdr *fhdr, int nhoff) 392 struct frag_hdr *fhdr, int nhoff)
393{ 393{
394 struct sk_buff *prev, *next; 394 struct sk_buff *prev, *next;
@@ -405,12 +405,12 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
405 405
406 if ((unsigned int)end > IPV6_MAXPLEN) { 406 if ((unsigned int)end > IPV6_MAXPLEN) {
407 DEBUGP("offset is too large.\n"); 407 DEBUGP("offset is too large.\n");
408 return -1; 408 return -1;
409 } 409 }
410 410
411 if (skb->ip_summed == CHECKSUM_COMPLETE) 411 if (skb->ip_summed == CHECKSUM_COMPLETE)
412 skb->csum = csum_sub(skb->csum, 412 skb->csum = csum_sub(skb->csum,
413 csum_partial(skb->nh.raw, 413 csum_partial(skb->nh.raw,
414 (u8*)(fhdr + 1) - skb->nh.raw, 414 (u8*)(fhdr + 1) - skb->nh.raw,
415 0)); 415 0));
416 416
@@ -625,7 +625,7 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
625 /* We have to remove fragment header from datagram and to relocate 625 /* We have to remove fragment header from datagram and to relocate
626 * header in order to calculate ICV correctly. */ 626 * header in order to calculate ICV correctly. */
627 head->nh.raw[fq->nhoffset] = head->h.raw[0]; 627 head->nh.raw[fq->nhoffset] = head->h.raw[0];
628 memmove(head->head + sizeof(struct frag_hdr), head->head, 628 memmove(head->head + sizeof(struct frag_hdr), head->head,
629 (head->data - head->head) - sizeof(struct frag_hdr)); 629 (head->data - head->head) - sizeof(struct frag_hdr));
630 head->mac.raw += sizeof(struct frag_hdr); 630 head->mac.raw += sizeof(struct frag_hdr);
631 head->nh.raw += sizeof(struct frag_hdr); 631 head->nh.raw += sizeof(struct frag_hdr);
@@ -701,41 +701,41 @@ out_fail:
701static int 701static int
702find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff) 702find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff)
703{ 703{
704 u8 nexthdr = skb->nh.ipv6h->nexthdr; 704 u8 nexthdr = skb->nh.ipv6h->nexthdr;
705 u8 prev_nhoff = (u8 *)&skb->nh.ipv6h->nexthdr - skb->data; 705 u8 prev_nhoff = (u8 *)&skb->nh.ipv6h->nexthdr - skb->data;
706 int start = (u8 *)(skb->nh.ipv6h+1) - skb->data; 706 int start = (u8 *)(skb->nh.ipv6h+1) - skb->data;
707 int len = skb->len - start; 707 int len = skb->len - start;
708 u8 prevhdr = NEXTHDR_IPV6; 708 u8 prevhdr = NEXTHDR_IPV6;
709 709
710 while (nexthdr != NEXTHDR_FRAGMENT) { 710 while (nexthdr != NEXTHDR_FRAGMENT) {
711 struct ipv6_opt_hdr hdr; 711 struct ipv6_opt_hdr hdr;
712 int hdrlen; 712 int hdrlen;
713 713
714 if (!ipv6_ext_hdr(nexthdr)) { 714 if (!ipv6_ext_hdr(nexthdr)) {
715 return -1; 715 return -1;
716 } 716 }
717 if (len < (int)sizeof(struct ipv6_opt_hdr)) { 717 if (len < (int)sizeof(struct ipv6_opt_hdr)) {
718 DEBUGP("too short\n"); 718 DEBUGP("too short\n");
719 return -1; 719 return -1;
720 } 720 }
721 if (nexthdr == NEXTHDR_NONE) { 721 if (nexthdr == NEXTHDR_NONE) {
722 DEBUGP("next header is none\n"); 722 DEBUGP("next header is none\n");
723 return -1; 723 return -1;
724 } 724 }
725 if (skb_copy_bits(skb, start, &hdr, sizeof(hdr))) 725 if (skb_copy_bits(skb, start, &hdr, sizeof(hdr)))
726 BUG(); 726 BUG();
727 if (nexthdr == NEXTHDR_AUTH) 727 if (nexthdr == NEXTHDR_AUTH)
728 hdrlen = (hdr.hdrlen+2)<<2; 728 hdrlen = (hdr.hdrlen+2)<<2;
729 else 729 else
730 hdrlen = ipv6_optlen(&hdr); 730 hdrlen = ipv6_optlen(&hdr);
731 731
732 prevhdr = nexthdr; 732 prevhdr = nexthdr;
733 prev_nhoff = start; 733 prev_nhoff = start;
734 734
735 nexthdr = hdr.nexthdr; 735 nexthdr = hdr.nexthdr;
736 len -= hdrlen; 736 len -= hdrlen;
737 start += hdrlen; 737 start += hdrlen;
738 } 738 }
739 739
740 if (len < 0) 740 if (len < 0)
741 return -1; 741 return -1;
@@ -749,7 +749,7 @@ find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff)
749 749
750struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb) 750struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb)
751{ 751{
752 struct sk_buff *clone; 752 struct sk_buff *clone;
753 struct net_device *dev = skb->dev; 753 struct net_device *dev = skb->dev;
754 struct frag_hdr *fhdr; 754 struct frag_hdr *fhdr;
755 struct nf_ct_frag6_queue *fq; 755 struct nf_ct_frag6_queue *fq;