From: Eric Dumazet <dada1@cosmosbay.com>
To: Wang Chen <wangchen@cn.fujitsu.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH 2/2] SOCK: add raw6 drops counter
Date: Wed, 14 Nov 2007 06:48:27 +0100 [thread overview]
Message-ID: <473A8C2B.2040709@cosmosbay.com> (raw)
In-Reply-To: <473A686D.9020200@cn.fujitsu.com>
Wang Chen a écrit :
> Add raw drops counter for IPv6 in /proc/net/raw6 .
>
> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
> ---
> raw.c | 15 ++++++++-------
> 1 files changed, 8 insertions(+), 7 deletions(-)
>
> diff -Nurp linux-2.6.24-rc2.org/net/ipv6/raw.c linux-2.6.24-rc2/net/ipv6/raw.c
> --- linux-2.6.24-rc2.org/net/ipv6/raw.c 2007-11-09 16:38:05.000000000 +0800
> +++ linux-2.6.24-rc2/net/ipv6/raw.c 2007-11-14 09:46:54.000000000 +0800
> @@ -354,14 +354,14 @@ static inline int rawv6_rcv_skb(struct s
> {
> if ((raw6_sk(sk)->checksum || sk->sk_filter) &&
> skb_checksum_complete(skb)) {
> - /* FIXME: increment a raw6 drops counter here */
> + atomic_inc(&sk->sk_drops);
I am not sure the comment was refering to a per socket counter here.
If the frame checksum is bad, we can not be sure the socket is OK, since the
garbaged bits could be in the tuple that identify the socket.
Maybe here we want to increment a global raw6 drop counter (well, for the
given ipv6 instance)
> kfree_skb(skb);
> return 0;
> }
>
> /* Charge it to the socket. */
> if (sock_queue_rcv_skb(sk,skb)<0) {
> - /* FIXME: increment a raw6 drops counter here */
> + atomic_inc(&sk->sk_drops);
> kfree_skb(skb);
> return 0;
> }
> @@ -382,6 +382,7 @@ int rawv6_rcv(struct sock *sk, struct sk
> struct raw6_sock *rp = raw6_sk(sk);
>
> if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) {
> + atomic_inc(&sk->sk_drops);
> kfree_skb(skb);
> return NET_RX_DROP;
> }
> @@ -405,7 +406,7 @@ int rawv6_rcv(struct sock *sk, struct sk
>
> if (inet->hdrincl) {
> if (skb_checksum_complete(skb)) {
> - /* FIXME: increment a raw6 drops counter here */
> + atomic_inc(&sk->sk_drops);
Same remark here.
next prev parent reply other threads:[~2007-11-14 5:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-13 9:57 [PATCH] IPV4: add raw drops counter Wang Chen
2007-11-13 11:11 ` Eric Dumazet
2007-11-14 1:27 ` Wang Chen
2007-11-14 6:00 ` Eric Dumazet
2007-11-14 3:12 ` [PATCH 1/2] SOCK: " Wang Chen
2007-11-14 3:15 ` [PATCH 2/2] SOCK: add raw6 " Wang Chen
2007-11-14 4:31 ` David Miller
2007-11-14 4:50 ` Wang Chen
2007-11-14 5:48 ` Eric Dumazet [this message]
2007-11-14 6:45 ` Wang Chen
2007-11-14 4:30 ` [PATCH 1/2] SOCK: add raw " David Miller
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=473A8C2B.2040709@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=wangchen@cn.fujitsu.com \
/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 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).