]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/ipmr.c
[SK_BUFF]: Introduce skb_transport_header(skb)
[net-next-2.6.git] / net / ipv4 / ipmr.c
index 05bc27002def409799eb3b1c49b9f395758efcc9..8f45c95db451a2f4083785b6454d89fb72018376 100644 (file)
@@ -1437,7 +1437,8 @@ int pim_rcv_v1(struct sk_buff * skb)
            pim->group != PIM_V1_VERSION || pim->code != PIM_V1_REGISTER)
                goto drop;
 
-       encap = (struct iphdr*)(skb->h.raw + sizeof(struct igmphdr));
+       encap = (struct iphdr *)(skb_transport_header(skb) +
+                                sizeof(struct igmphdr));
        /*
           Check that:
           a. packet is really destinted to a multicast group
@@ -1490,7 +1491,7 @@ static int pim_rcv(struct sk_buff * skb)
        if (!pskb_may_pull(skb, sizeof(*pim) + sizeof(*encap)))
                goto drop;
 
-       pim = (struct pimreghdr*)skb->h.raw;
+       pim = (struct pimreghdr *)skb_transport_header(skb);
        if (pim->type != ((PIM_VERSION<<4)|(PIM_REGISTER)) ||
            (pim->flags&PIM_NULL_REGISTER) ||
            (ip_compute_csum((void *)pim, sizeof(*pim)) != 0 &&
@@ -1498,7 +1499,8 @@ static int pim_rcv(struct sk_buff * skb)
                goto drop;
 
        /* check if the inner packet is destined to mcast group */
-       encap = (struct iphdr*)(skb->h.raw + sizeof(struct pimreghdr));
+       encap = (struct iphdr *)(skb_transport_header(skb) +
+                                sizeof(struct pimreghdr));
        if (!MULTICAST(encap->daddr) ||
            encap->tot_len == 0 ||
            ntohs(encap->tot_len) + sizeof(*pim) > skb->len)