Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
[pandora-kernel.git] / net / ipv6 / reassembly.c
index f85e49a..de795c0 100644 (file)
@@ -430,8 +430,8 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
                goto err;
 
        offset = ntohs(fhdr->frag_off) & ~0x7;
-       end = offset + (ntohs(skb->nh.ipv6h->payload_len) -
-                       ((u8 *) (fhdr + 1) - (u8 *) (skb->nh.ipv6h + 1)));
+       end = offset + (ntohs(ipv6_hdr(skb)->payload_len) -
+                       ((u8 *)(fhdr + 1) - (u8 *)(ipv6_hdr(skb) + 1)));
 
        if ((unsigned int)end > IPV6_MAXPLEN) {
                IP6_INC_STATS_BH(ip6_dst_idev(skb->dst),
@@ -646,14 +646,14 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
        /* We have to remove fragment header from datagram and to relocate
         * header in order to calculate ICV correctly. */
        nhoff = fq->nhoffset;
-       skb_network_header(head)[nhoff] = head->h.raw[0];
+       skb_network_header(head)[nhoff] = skb_transport_header(head)[0];
        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);
+       head->mac_header += sizeof(struct frag_hdr);
+       head->network_header += sizeof(struct frag_hdr);
 
        skb_shinfo(head)->frag_list = head->next;
-       head->h.raw = head->data;
+       skb_reset_transport_header(head);
        skb_push(head, head->data - skb_network_header(head));
        atomic_sub(head->truesize, &ip6_frag_mem);
 
@@ -671,7 +671,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
        head->next = NULL;
        head->dev = dev;
        head->tstamp = fq->stamp;
-       head->nh.ipv6h->payload_len = htons(payload_len);
+       ipv6_hdr(head)->payload_len = htons(payload_len);
        IP6CB(head)->nhoff = nhoff;
 
        *skb_in = head;
@@ -679,7 +679,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
        /* Yes, and fold redundant checksum back. 8) */
        if (head->ip_summed == CHECKSUM_COMPLETE)
                head->csum = csum_partial(skb_network_header(head),
-                                         head->h.raw - head->nh.raw,
+                                         skb_network_header_len(head),
                                          head->csum);
 
        rcu_read_lock();
@@ -708,30 +708,31 @@ static int ipv6_frag_rcv(struct sk_buff **skbp)
        struct net_device *dev = skb->dev;
        struct frag_hdr *fhdr;
        struct frag_queue *fq;
-       struct ipv6hdr *hdr;
-
-       hdr = skb->nh.ipv6h;
+       struct ipv6hdr *hdr = ipv6_hdr(skb);
 
        IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMREQDS);
 
        /* Jumbo payload inhibits frag. header */
        if (hdr->payload_len==0) {
                IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS);
-               icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
+               icmpv6_param_prob(skb, ICMPV6_HDR_FIELD,
+                                 skb_network_header_len(skb));
                return -1;
        }
-       if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+sizeof(struct frag_hdr))) {
+       if (!pskb_may_pull(skb, (skb_transport_offset(skb) +
+                                sizeof(struct frag_hdr)))) {
                IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INHDRERRORS);
-               icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
+               icmpv6_param_prob(skb, ICMPV6_HDR_FIELD,
+                                 skb_network_header_len(skb));
                return -1;
        }
 
-       hdr = skb->nh.ipv6h;
-       fhdr = (struct frag_hdr *)skb->h.raw;
+       hdr = ipv6_hdr(skb);
+       fhdr = (struct frag_hdr *)skb_transport_header(skb);
 
        if (!(fhdr->frag_off & htons(0xFFF9))) {
                /* It is not a fragmented frame */
-               skb->h.raw += sizeof(struct frag_hdr);
+               skb->transport_header += sizeof(struct frag_hdr);
                IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_REASMOKS);
 
                IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb);