netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix UDP filter condition when do checksum
@ 2006-07-31 10:33 Wei Yongjun
  2006-07-31 11:36 ` Herbert Xu
  2006-07-31 12:02 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2006-07-31 10:33 UTC (permalink / raw)
  To: netdev; +Cc: David Miller

In udp_queue_rcv_skb(), checksum condition is error. When UDP filter is
set, checksum is be done, but if UDP filter is not set, checksum will
not be done. So I think this is a BUG. Following is my patch:

--- a/net/ipv4/udp.c	2006-07-31 09:33:45.392479344 -0400
+++ b/net/ipv4/udp.c	2006-07-31 17:10:41.271632200 -0400
@@ -1018,7 +1018,7 @@ static int udp_queue_rcv_skb(struct sock
 		/* FALLTHROUGH -- it's a UDP Packet */
 	}
 
-	if (sk->sk_filter && skb->ip_summed != CHECKSUM_UNNECESSARY) {
+	if (!sk->sk_filter && skb->ip_summed != CHECKSUM_UNNECESSARY) {
 		if (__udp_checksum_complete(skb)) {
 			UDP_INC_STATS_BH(UDP_MIB_INERRORS);
 			kfree_skb(skb);


Signed-off-by: Wei Yongjun <yjwei@nanjing-fnst.com>\x11
`ß'	\x19



'	c link




>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-31 12:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-31 10:33 [PATCH] Fix UDP filter condition when do checksum Wei Yongjun
2006-07-31 11:36 ` Herbert Xu
2006-07-31 12:02 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).