diff options
-rw-r--r-- | net/ipv4/inet_diag.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 31cf54d18221..45dbdab915e2 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -961,7 +961,7 @@ next_normal: | |||
961 | ++num; | 961 | ++num; |
962 | } | 962 | } |
963 | 963 | ||
964 | if (r->idiag_states & TCPF_TIME_WAIT) { | 964 | if (r->idiag_states & (TCPF_TIME_WAIT | TCPF_FIN_WAIT2)) { |
965 | struct inet_timewait_sock *tw; | 965 | struct inet_timewait_sock *tw; |
966 | 966 | ||
967 | inet_twsk_for_each(tw, node, | 967 | inet_twsk_for_each(tw, node, |
@@ -971,6 +971,8 @@ next_normal: | |||
971 | 971 | ||
972 | if (num < s_num) | 972 | if (num < s_num) |
973 | goto next_dying; | 973 | goto next_dying; |
974 | if (!(r->idiag_states & (1 << tw->tw_substate))) | ||
975 | goto next_dying; | ||
974 | if (r->sdiag_family != AF_UNSPEC && | 976 | if (r->sdiag_family != AF_UNSPEC && |
975 | tw->tw_family != r->sdiag_family) | 977 | tw->tw_family != r->sdiag_family) |
976 | goto next_dying; | 978 | goto next_dying; |