Commit 27890f3b authored by Tim Shepard's avatar Tim Shepard Committed by David S. Miller

[TCP]: Fix missing connections in /proc/net/tcp

parent 359a118a
...@@ -2235,10 +2235,11 @@ static void *listening_get_idx(struct seq_file *seq, loff_t *pos) ...@@ -2235,10 +2235,11 @@ static void *listening_get_idx(struct seq_file *seq, loff_t *pos)
{ {
void *rc = listening_get_first(seq); void *rc = listening_get_first(seq);
if (rc) while (rc && *pos) {
while (*pos && (rc = listening_get_next(seq, rc))) rc = listening_get_next(seq, rc);
--*pos; --*pos;
return *pos ? NULL : rc; }
return rc;
} }
static void *established_get_first(struct seq_file *seq) static void *established_get_first(struct seq_file *seq)
...@@ -2327,10 +2328,11 @@ static void *established_get_idx(struct seq_file *seq, loff_t pos) ...@@ -2327,10 +2328,11 @@ static void *established_get_idx(struct seq_file *seq, loff_t pos)
{ {
void *rc = established_get_first(seq); void *rc = established_get_first(seq);
if (rc) while (rc && pos) {
while (pos && (rc = established_get_next(seq, rc))) rc = established_get_next(seq, rc);
--pos; --pos;
return pos ? NULL : rc; }
return rc;
} }
static void *tcp_get_idx(struct seq_file *seq, loff_t pos) static void *tcp_get_idx(struct seq_file *seq, loff_t pos)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment