aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/tcp_diag.c5
-rw-r--r--net/ipv4/tcp_ipv4.c3
-rw-r--r--net/ipv6/tcp_ipv6.c3
3 files changed, 8 insertions, 3 deletions
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index c148c1081880..b56399c7cc12 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -26,7 +26,10 @@ static void tcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
26 const struct tcp_sock *tp = tcp_sk(sk); 26 const struct tcp_sock *tp = tcp_sk(sk);
27 struct tcp_info *info = _info; 27 struct tcp_info *info = _info;
28 28
29 r->idiag_rqueue = tp->rcv_nxt - tp->copied_seq; 29 if (sk->sk_state == TCP_LISTEN)
30 r->idiag_rqueue = sk->sk_ack_backlog;
31 else
32 r->idiag_rqueue = tp->rcv_nxt - tp->copied_seq;
30 r->idiag_wqueue = tp->write_seq - tp->snd_una; 33 r->idiag_wqueue = tp->write_seq - tp->snd_una;
31 if (info != NULL) 34 if (info != NULL)
32 tcp_get_info(sk, info); 35 tcp_get_info(sk, info);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 25ecc6e2478b..4c6ef47eb1c3 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1726,7 +1726,8 @@ static void get_tcp4_sock(struct sock *sp, char *tmpbuf, int i)
1726 sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX " 1726 sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX "
1727 "%08X %5d %8d %lu %d %p %u %u %u %u %d", 1727 "%08X %5d %8d %lu %d %p %u %u %u %u %d",
1728 i, src, srcp, dest, destp, sp->sk_state, 1728 i, src, srcp, dest, destp, sp->sk_state,
1729 tp->write_seq - tp->snd_una, tp->rcv_nxt - tp->copied_seq, 1729 tp->write_seq - tp->snd_una,
1730 (sp->sk_state == TCP_LISTEN) ? sp->sk_ack_backlog : (tp->rcv_nxt - tp->copied_seq),
1730 timer_active, 1731 timer_active,
1731 jiffies_to_clock_t(timer_expires - jiffies), 1732 jiffies_to_clock_t(timer_expires - jiffies),
1732 icsk->icsk_retransmits, 1733 icsk->icsk_retransmits,
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index a50eb306e9e2..b36d5b2e7c30 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1469,7 +1469,8 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
1469 dest->s6_addr32[0], dest->s6_addr32[1], 1469 dest->s6_addr32[0], dest->s6_addr32[1],
1470 dest->s6_addr32[2], dest->s6_addr32[3], destp, 1470 dest->s6_addr32[2], dest->s6_addr32[3], destp,
1471 sp->sk_state, 1471 sp->sk_state,
1472 tp->write_seq-tp->snd_una, tp->rcv_nxt-tp->copied_seq, 1472 tp->write_seq-tp->snd_una,
1473 (sp->sk_state == TCP_LISTEN) ? sp->sk_ack_backlog : (tp->rcv_nxt - tp->copied_seq),
1473 timer_active, 1474 timer_active,
1474 jiffies_to_clock_t(timer_expires - jiffies), 1475 jiffies_to_clock_t(timer_expires - jiffies),
1475 icsk->icsk_retransmits, 1476 icsk->icsk_retransmits,