From: Pavel Emelyanov <xemul@parallels.com>
To: Herbert Xu <herbert@gondor.apana.org.au>, <netdev@vger.kernel.org>
Subject: Re: udp_diag: Fix socket skipping within chain
Date: Mon, 26 Jan 2015 14:07:15 +0300 [thread overview]
Message-ID: <54C61FE3.5030001@parallels.com> (raw)
In-Reply-To: <20150123210240.GA1569@gondor.apana.org.au>
On 01/24/2015 12:02 AM, Herbert Xu wrote:
> While working on rhashtable walking I noticed that the UDP diag
> dumping code is buggy. In particular, the socket skipping within
> a chain never happens, even though we record the number of sockets
> that should be skipped.
>
> As this code was supposedly copied from TCP, this patch does what
> TCP does and resets num before we walk a chain.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Thanks,
Pavel
> diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c
> index 7927db0..4a000f1 100644
> --- a/net/ipv4/udp_diag.c
> +++ b/net/ipv4/udp_diag.c
> @@ -99,11 +99,13 @@ static void udp_dump(struct udp_table *table, struct sk_buff *skb, struct netlin
> s_slot = cb->args[0];
> num = s_num = cb->args[1];
>
> - for (slot = s_slot; slot <= table->mask; num = s_num = 0, slot++) {
> + for (slot = s_slot; slot <= table->mask; s_num = 0, slot++) {
> struct sock *sk;
> struct hlist_nulls_node *node;
> struct udp_hslot *hslot = &table->hash[slot];
>
> + num = 0;
> +
> if (hlist_nulls_empty(&hslot->head))
> continue;
>
>
next prev parent reply other threads:[~2015-01-26 11:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 21:02 udp_diag: Fix socket skipping within chain Herbert Xu
2015-01-26 11:07 ` Pavel Emelyanov [this message]
2015-01-27 8:03 ` 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=54C61FE3.5030001@parallels.com \
--to=xemul@parallels.com \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.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.