tree a3052c4ffdfa8451a182c49837a92054f5688672
parent e50ef933e649a2b43aa10c8a60c491543b8b4c02
author Stephen Hemminger <[EMAIL PROTECTED]> Fri, 09 Sep 2005 02:57:43 -0700
committer David S. Miller <[EMAIL PROTECTED]> Fri, 09 Sep 2005 02:57:43 -0700

[IPV6]: Need to use pskb_trim_rcsum().

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 <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

 net/ipv6/exthdrs.c    |    9 ++++-----
 net/ipv6/reassembly.c |    9 +++------
 net/ipv6/udp.c        |    2 +-
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -459,11 +459,10 @@ static int ipv6_hop_jumbo(struct sk_buff
                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:
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -479,12 +479,9 @@ static void ip6_frag_queue(struct frag_q
        /* 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
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -483,7 +483,7 @@ static int udpv6_rcv(struct sk_buff **ps
        }
 
        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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to