Netdev List
 help / color / mirror / Atom feed
From: akpm@osdl.org
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, akpm@osdl.org, Jari.Takkala@Q9.com,
	jari.takkala@Q9.com
Subject: [patch 06/17] neighbour.c, pneigh_get_next() skips published entry
Date: Thu, 01 Jun 2006 20:32:26 -0700	[thread overview]
Message-ID: <200606020328.k523S8hh028820@shell0.pdx.osdl.net> (raw)


From: "Jari Takkala" <Jari.Takkala@Q9.com>

Fix a problem where output from /proc/net/arp skips a record when the full
output does not fit into the users read() buffer.

To reproduce: publish a large number of ARP entries (more than 10 required
on my system).  Run 'dd if=/proc/net/arp of=arp-1024.out bs=1024'.  View
the output, one entry will be missing.

Signed-off-by: Jari Takkala <jari.takkala@q9.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 net/core/neighbour.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN net/core/neighbour.c~neighbourc-pneigh_get_next-skips-published-entry net/core/neighbour.c
--- devel/net/core/neighbour.c~neighbourc-pneigh_get_next-skips-published-entry	2006-06-01 20:31:49.000000000 -0700
+++ devel-akpm/net/core/neighbour.c	2006-06-01 20:31:49.000000000 -0700
@@ -2138,6 +2138,12 @@ static struct pneigh_entry *pneigh_get_n
 	struct neigh_seq_state *state = seq->private;
 	struct neigh_table *tbl = state->tbl;
 
+	if (pos != NULL && *pos == 1 &&
+			(pn->next || tbl->phash_buckets[state->bucket])) {
+		--(*pos);
+		return pn;
+	}
+
 	pn = pn->next;
 	while (!pn) {
 		if (++state->bucket > PNEIGH_HASHMASK)
_

             reply	other threads:[~2006-06-02  3:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-02  3:32 akpm [this message]
2006-06-05 23:30 ` [patch 06/17] neighbour.c, pneigh_get_next() skips published entry David Miller
  -- strict thread matches above, loose matches on Subject: below --
2006-06-08 18:21 Jari Takkala
2006-06-09  4:52 ` Herbert Xu
2006-06-09 20:14 Jari Takkala

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=200606020328.k523S8hh028820@shell0.pdx.osdl.net \
    --to=akpm@osdl.org \
    --cc=Jari.Takkala@Q9.com \
    --cc=davem@davemloft.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox