From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org,
YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Subject: Re: [UDP6]: Restore sk_filter optimisation
Date: Mon, 29 Oct 2007 15:33:20 +0900 [thread overview]
Message-ID: <20071029153320.d2c00f62.mitch@linux.vnet.ibm.com> (raw)
In-Reply-To: <20070306012010.GA25763@gondor.apana.org.au>
Hello Herbert,
Let me ask a question about this patch.
After this patch was applied, 2 of the protocol stack behaviors were
changed when it receives a UDP datagram with broken checksum:
1. udp6InDatagrams is incremented instead of udpInErrors
2. In userland, recvfrom() replies an error with EAGAIN.
recvfrom() wasn't aware of such a packet before.
Are these changes intentional?
Best Regards,
----
Mitsuru Chinen <mitch@linux.vnet.ibm.com>
On Tue, 6 Mar 2007 12:20:10 +1100
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> Hi Dave:
>
> [UDP6]: Restore sk_filter optimisation
>
> This reverts the changeset
>
> [IPV6]: UDPv6 checksum.
>
> We always need to check UDPv6 checksum because it is mandatory.
>
> The sk_filter optimisation has nothing to do whether we verify the
> checksum. It simply postpones it to the point when the user calls
> recv or poll.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> Cheers,
> --
> Visit Openswan at http://www.openswan.org/
> Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> --
> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> index 0ad4719..4474480 100644
> --- a/net/ipv6/udp.c
> +++ b/net/ipv6/udp.c
> @@ -279,8 +279,10 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
> }
> }
>
> - if (udp_lib_checksum_complete(skb))
> - goto drop;
> + if (sk->sk_filter) {
> + if (udp_lib_checksum_complete(skb))
> + goto drop;
> + }
>
> if ((rc = sock_queue_rcv_skb(sk,skb)) < 0) {
> /* Note that an ENOMEM error is charged twice */
next prev parent reply other threads:[~2007-10-29 6:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-06 1:20 [UDP6]: Restore sk_filter optimisation Herbert Xu
2007-03-07 4:30 ` David Miller
2007-10-29 6:33 ` Mitsuru Chinen [this message]
2007-10-29 6:41 ` YOSHIFUJI Hideaki / 吉藤英明
2007-10-29 12:53 ` Herbert Xu
2007-10-31 14:05 ` Mitsuru Chinen
2007-10-31 14:42 ` Herbert Xu
2007-11-01 13:34 ` Mitsuru Chinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071029153320.d2c00f62.mitch@linux.vnet.ibm.com \
--to=mitch@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.