]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Fix UDP header pointer after pskb_trim_rcsum()
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 8 Mar 2007 02:50:54 +0000 (18:50 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 13 Mar 2007 18:26:47 +0000 (11:26 -0700)
[UDP]: Reread uh pointer after pskb_trim

The header may have moved when trimming.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/udp.c

index cfff930f2bafc78039908c1ab728d2340e4dc26d..f8068b06a26122356bbbd8363904bb23df1077ed 100644 (file)
@@ -1214,6 +1214,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
 
                if (ulen < sizeof(*uh) || pskb_trim_rcsum(skb, ulen))
                        goto short_packet;
+               uh = skb->h.uh;
 
                udp4_csum_init(skb, uh);