]> git.hungrycats.org Git - linux/commitdiff
[IPV6]: Use sizeof(struct frag_hdr) instead of magic value.
authorHideaki Yoshifuji <yoshfuji@linux-ipv6.org>
Wed, 11 Jun 2003 17:56:28 +0000 (10:56 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Wed, 11 Jun 2003 17:56:28 +0000 (10:56 -0700)
net/ipv6/reassembly.c

index 56d2c8dfbf7621772ec5289b6789c495fc38987d..92e6ff6c41b67a55d87d487bd53c0df9b8bca706 100644 (file)
@@ -596,7 +596,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
        BUG_TRAP(FRAG6_CB(head)->offset == 0);
 
        /* Unfragmented part is taken from the first segment. */
-       payload_len = (head->data - head->nh.raw) - sizeof(struct ipv6hdr) + fq->len - 8;
+       payload_len = (head->data - head->nh.raw) - sizeof(struct ipv6hdr) + fq->len - sizeof(struct frag_hdr);
        if (payload_len > 65535)
                goto out_oversize;
 
@@ -631,9 +631,10 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
         * header in order to calculate ICV correctly. */
        nhoff = fq->nhoffset;
        head->nh.raw[nhoff] = head->h.raw[0];
-       memmove(head->head+8, head->head, (head->data-head->head)-8);
-       head->mac.raw += 8;
-       head->nh.raw += 8;
+       memmove(head->head + sizeof(struct frag_hdr), head->head, 
+               (head->data - head->head) - sizeof(struct frag_hdr));
+       head->mac.raw += sizeof(struct frag_hdr);
+       head->nh.raw += sizeof(struct frag_hdr);
 
        skb_shinfo(head)->frag_list = head->next;
        head->h.raw = head->data;