[SK_BUFF]: Introduce skb_network_header()
[deliverable/linux.git] / net / ipv6 / raw.c
index 306d5d83c06803727e2b9b64cd8e57e08e11fd80..9b2bcde73f1969eb521a0d89d45989022924d95b 100644 (file)
@@ -361,7 +361,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb)
                skb->ip_summed = CHECKSUM_UNNECESSARY;
 
        if (skb->ip_summed == CHECKSUM_COMPLETE) {
-               skb_postpull_rcsum(skb, skb->nh.raw,
+               skb_postpull_rcsum(skb, skb_network_header(skb),
                                   skb->h.raw - skb->nh.raw);
                if (!csum_ipv6_magic(&skb->nh.ipv6h->saddr,
                                     &skb->nh.ipv6h->daddr,
@@ -488,7 +488,8 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl,
                goto out;
 
        offset = rp->offset;
-       total_len = inet_sk(sk)->cork.length - (skb->nh.raw - skb->data);
+       total_len = inet_sk(sk)->cork.length - (skb_network_header(skb) -
+                                               skb->data);
        if (offset >= total_len - 1) {
                err = -EINVAL;
                ip6_flush_pending_frames(sk);
@@ -575,7 +576,9 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
        skb->priority = sk->sk_priority;
        skb->dst = dst_clone(&rt->u.dst);
 
-       skb->nh.ipv6h = iph = (struct ipv6hdr *)skb_put(skb, length);
+       skb_put(skb, length);
+       skb_reset_network_header(skb);
+       iph = skb->nh.ipv6h;
 
        skb->ip_summed = CHECKSUM_NONE;
 
@@ -687,9 +690,9 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
        int err;
 
        /* Rough check on arithmetic overflow,
-          better check is made in ip6_build_xmit
+          better check is made in ip6_append_data().
         */
-       if (len < 0)
+       if (len > INT_MAX)
                return -EMSGSIZE;
 
        /* Mirror BSD error message compatibility */
This page took 0.024111 seconds and 5 git commands to generate.