X25 fix dead unaccepted sockets
authorandrew hendry <andrew.hendry@gmail.com>
Sat, 17 Apr 2010 14:17:32 +0000 (14:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Apr 2010 23:31:50 +0000 (16:31 -0700)
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>
net/x25/af_x25.c

index cbddd0cb83f1a2445ba26f60225b0fa15a6a21b2..36e84e13c6aa9f6167d9b6ba2cf48b72829c2d58 100644 (file)
@@ -402,6 +402,7 @@ static void __x25_destroy_socket(struct sock *sk)
                        /*
                         * Queue the unaccepted socket for death
                         */
+                       skb->sk->sk_state = TCP_LISTEN;
                        sock_set_flag(skb->sk, SOCK_DEAD);
                        x25_start_heartbeat(skb->sk);
                        x25_sk(skb->sk)->state = X25_STATE_0;