Message ID | 1391596801-21718-1-git-send-email-luis.henriques@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index e530c31..60e48d7 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -941,7 +941,7 @@ next_normal: ++num; } - if (r->idiag_states & TCPF_TIME_WAIT) { + if (r->idiag_states & (TCPF_TIME_WAIT | TCPF_FIN_WAIT2)) { struct inet_timewait_sock *tw; inet_twsk_for_each(tw, node, @@ -949,6 +949,8 @@ next_normal: if (num < s_num) goto next_dying; + if (!(r->idiag_states & (1 << tw->tw_substate))) + goto next_dying; if (r->sdiag_family != AF_UNSPEC && tw->tw_family != r->sdiag_family) goto next_dying;