diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-01-24 17:41:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-24 17:41:20 -0500 |
commit | fd0273c5033630b8673554cd39660435d1ab2ac4 (patch) | |
tree | e13f583f7848dcc1c620f3e4598e22f96a2d8efc | |
parent | 3408404a4c2a4eead9d73b0bbbfe3f225b65f492 (diff) |
tcp: fix bug in listening_get_next()
commit a8b690f98baf9fb19 (tcp: Fix slowness in read /proc/net/tcp)
introduced a bug in handling of SYN_RECV sockets.
st->offset represents number of sockets found since beginning of
listening_hash[st->bucket].
We should not reset st->offset when iterating through
syn_table[st->sbucket], or else if more than ~25 sockets (if
PAGE_SIZE=4096) are in SYN_RECV state, we exit from listening_get_next()
with a too small st->offset
Next time we enter tcp_seek_last_pos(), we are not able to seek past
already found sockets.
Reported-by: PK <runningdoglackey@yahoo.com>
CC: Tom Herbert <therbert@google.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 856f68466d49..02f583b3744a 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1994,7 +1994,6 @@ static void *listening_get_next(struct seq_file *seq, void *cur) | |||
1994 | } | 1994 | } |
1995 | req = req->dl_next; | 1995 | req = req->dl_next; |
1996 | } | 1996 | } |
1997 | st->offset = 0; | ||
1998 | if (++st->sbucket >= icsk->icsk_accept_queue.listen_opt->nr_table_entries) | 1997 | if (++st->sbucket >= icsk->icsk_accept_queue.listen_opt->nr_table_entries) |
1999 | break; | 1998 | break; |
2000 | get_req: | 1999 | get_req: |