Skip to content

Commit

Permalink
inet_diag: adjust inet_sk_diag_fill() bug condition
Browse files Browse the repository at this point in the history
inet_sk_diag_fill() only copes with non timewait and non request socks

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Mar 14, 2015
1 parent 16f8616 commit a07c920
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/inet_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
return -EMSGSIZE;

r = nlmsg_data(nlh);
BUG_ON(sk->sk_state == TCP_TIME_WAIT);
BUG_ON((1 << sk->sk_state) & (TCPF_TIME_WAIT | TCPF_NEW_SYN_RECV));

r->idiag_family = sk->sk_family;
r->idiag_state = sk->sk_state;
Expand Down

0 comments on commit a07c920

Please sign in to comment.