[SK_BUFF]: Introduce skb_network_header()
[powerpc.git] / net / ipv6 / ip6_input.c
index 4fdded0..aecc74d 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/types.h>
 #include <linux/socket.h>
 #include <linux/sockios.h>
-#include <linux/sched.h>
 #include <linux/net.h>
 #include <linux/netdevice.h>
 #include <linux/in6.h>
@@ -109,8 +108,10 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 
        /* pkt_len may be zero if Jumbo payload option is present */
        if (pkt_len || hdr->nexthdr != NEXTHDR_HOP) {
-               if (pkt_len + sizeof(struct ipv6hdr) > skb->len)
-                       goto truncated;
+               if (pkt_len + sizeof(struct ipv6hdr) > skb->len) {
+                       IP6_INC_STATS_BH(idev, IPSTATS_MIB_INTRUNCATEDPKTS);
+                       goto drop;
+               }
                if (pskb_trim_rcsum(skb, pkt_len + sizeof(struct ipv6hdr))) {
                        IP6_INC_STATS_BH(idev, IPSTATS_MIB_INHDRERRORS);
                        goto drop;
@@ -129,8 +130,6 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
        rcu_read_unlock();
 
        return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish);
-truncated:
-       IP6_INC_STATS_BH(idev, IPSTATS_MIB_INTRUNCATEDPKTS);
 err:
        IP6_INC_STATS_BH(idev, IPSTATS_MIB_INHDRERRORS);
 drop:
@@ -164,7 +163,7 @@ resubmit:
        if (!pskb_pull(skb, skb->h.raw - skb->data))
                goto discard;
        nhoff = IP6CB(skb)->nhoff;
-       nexthdr = skb->nh.raw[nhoff];
+       nexthdr = skb_network_header(skb)[nhoff];
 
        raw_sk = sk_head(&raw_v6_htable[nexthdr & (MAX_INET_PROTOS - 1)]);
        if (raw_sk && !ipv6_raw_deliver(skb, nexthdr))
@@ -182,7 +181,7 @@ resubmit:
                           indefinitely. */
                        nf_reset(skb);
 
-                       skb_postpull_rcsum(skb, skb->nh.raw,
+                       skb_postpull_rcsum(skb, skb_network_header(skb),
                                           skb->h.raw - skb->nh.raw);
                        hdr = skb->nh.ipv6h;
                        if (ipv6_addr_is_multicast(&hdr->daddr) &&