]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[IPV6]: Need to use pskb_trim_rcsum().
authorStephen Hemminger <shemminger@osdl.org>
Thu, 8 Sep 2005 19:57:43 +0000 (12:57 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Sep 2005 19:57:43 +0000 (12:57 -0700)
Fix pskb_trim usage in ipv6. Only the udp one is really
a bug, other places are just doing equivalent code.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/exthdrs.c
net/ipv6/reassembly.c
net/ipv6/udp.c

index 5be6da2584eec540d38d554b068b0d6ad5ebd910..3b9fa900a4bf73d40be0f86d56c10d160d64ccf6 100644 (file)
@@ -459,11 +459,10 @@ static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff)
                IP6_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS);
                goto drop;
        }
-       if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
-               __pskb_trim(skb, pkt_len + sizeof(struct ipv6hdr));
-               if (skb->ip_summed == CHECKSUM_HW)
-                       skb->ip_summed = CHECKSUM_NONE;
-       }
+
+       if (pskb_trim_rcsum(skb, pkt_len + sizeof(struct ipv6hdr)))
+               goto drop;
+
        return 1;
 
 drop:
index 9d9e04344c777c8bd331b7b1f5e566fae38351e4..e4fe9ee484ddab3d0f0fee7e0153e8de4f14c4be 100644 (file)
@@ -479,12 +479,9 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
        /* Point into the IP datagram 'data' part. */
        if (!pskb_pull(skb, (u8 *) (fhdr + 1) - skb->data))
                goto err;
-       if (end-offset < skb->len) {
-               if (pskb_trim(skb, end - offset))
-                       goto err;
-               if (skb->ip_summed != CHECKSUM_UNNECESSARY)
-                       skb->ip_summed = CHECKSUM_NONE;
-       }
+       
+       if (pskb_trim_rcsum(skb, end - offset))
+               goto err;
 
        /* Find out which fragments are in front and at the back of us
         * in the chain of fragments so far.  We must know where to put
index 390d750449ce6f801dd3ed906dd68fa7bcc20126..7cbcaa30cf5e82af47fb8836c321227e0363e9bd 100644 (file)
@@ -483,7 +483,7 @@ static int udpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
        }
 
        if (ulen < skb->len) {
-               if (__pskb_trim(skb, ulen))
+               if (pskb_trim_rcsum(skb, ulen))
                        goto discard;
                saddr = &skb->nh.ipv6h->saddr;
                daddr = &skb->nh.ipv6h->daddr;