Commit 2cec6b014da6fb4a40ba1c6556cdf9681ed3f89e

Authored by andrew hendry
Committed by David S. Miller
1 parent 761172fbf6

X25 fix dead unaccepted sockets

1, An X25 program binds and listens
2, calls arrive waiting to be accepted
3, Program exits without accepting
4, Sockets time out but don't get correctly cleaned up
5, cat /proc/net/x25/socket shows the dead sockets with bad inode fields.

This line borrowed from AX25 sets the dying socket so the timers clean up later.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

... ... @@ -402,6 +402,7 @@
402 402 /*
403 403 * Queue the unaccepted socket for death
404 404 */
  405 + skb->sk->sk_state = TCP_LISTEN;
405 406 sock_set_flag(skb->sk, SOCK_DEAD);
406 407 x25_start_heartbeat(skb->sk);
407 408 x25_sk(skb->sk)->state = X25_STATE_0;