[IPV4] udp: trim forgets about CHECKSUM_HW
authorStephen Hemminger <shemminger@osdl.org>
Thu, 8 Sep 2005 19:32:21 +0000 (12:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Sep 2005 19:32:21 +0000 (12:32 -0700)
A UDP packet may contain extra data that needs to be trimmed off.
But when doing so, UDP forgets to fixup the skb checksum if CHECKSUM_HW
is being used.

I think this explains the case of a NFS receive using skge driver
causing 'udp hw checksum failures' when interacting with a crufty
settop box.

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

index e5beca7de86c4b67e7455172ac66f6a7ad54ad49..e0bd1013cb0d0053c3d4b0f5fe0bbd2befa9ad48 100644 (file)
@@ -1141,7 +1141,7 @@ int udp_rcv(struct sk_buff *skb)
        if (ulen > len || ulen < sizeof(*uh))
                goto short_packet;
 
-       if (pskb_trim(skb, ulen))
+       if (pskb_trim_rcsum(skb, ulen))
                goto short_packet;
 
        if (udp_checksum_init(skb, uh, ulen, saddr, daddr) < 0)