Wei Yongjun <[EMAIL PROTECTED]> wrote:
> 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);

For the record, this isn't correct since the only reason we're computing
a checksum here rather than recv(2) time is if we have a filter attached.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
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

Reply via email to