Several places in IPV6 need to use pskb_trim_rcsum to handle
the case of skb's received on devices that set CHECKSUM_HW
Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Index: csum/net/ipv6/exthdrs.c
===================================================================
--- csum.orig/net/ipv6/exthdrs.c 2005-07-28 21:53:09.000000000 -0700
+++ csum/net/ipv6/exthdrs.c 2005-09-06 20:57:04.000000000 -0700
@@ -455,15 +455,11 @@
return 0;
}
- if (pkt_len > skb->len - sizeof(struct ipv6hdr)) {
+ if (pskb_trim_rcsum(skb, pkt_len + sizeof(struct ipv6hdr))) {
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;
- }
+
return 1;
drop:
Index: csum/net/ipv6/reassembly.c
===================================================================
--- csum.orig/net/ipv6/reassembly.c 2005-07-28 21:53:09.000000000 -0700
+++ csum/net/ipv6/reassembly.c 2005-09-06 20:57:32.000000000 -0700
@@ -479,12 +479,9 @@
/* 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: csum/net/ipv6/udp.c
===================================================================
--- csum.orig/net/ipv6/udp.c 2005-07-28 21:53:09.000000000 -0700
+++ csum/net/ipv6/udp.c 2005-09-06 20:57:52.000000000 -0700
@@ -482,13 +482,8 @@
goto discard;
}
- if (ulen < skb->len) {
- if (__pskb_trim(skb, ulen))
- goto discard;
- saddr = &skb->nh.ipv6h->saddr;
- daddr = &skb->nh.ipv6h->daddr;
- uh = skb->h.uh;
- }
+ if (pskb_trim_rcsum(skb, ulen))
+ goto discard;
if (skb->ip_summed==CHECKSUM_HW) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html