X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=net%2Fax25%2Fax25_std_timer.c;h=96e4b9273250918b4a60fdcc9ccce00b79090827;hb=347815fcc63ac4c4a975bf3ca2c889c2f843ae0d;hp=cdc7e751ef36129fc9e25f107d8beb1e58034faf;hpb=bc588df79ebfb710abc27342fccf336a68ed1216;p=~andy%2Flinux diff --git a/net/ax25/ax25_std_timer.c b/net/ax25/ax25_std_timer.c index cdc7e751ef3..96e4b927325 100644 --- a/net/ax25/ax25_std_timer.c +++ b/net/ax25/ax25_std_timer.c @@ -39,9 +39,11 @@ void ax25_std_heartbeat_expiry(ax25_cb *ax25) switch (ax25->state) { case AX25_STATE_0: - if (!sk || - sock_flag(sk, SOCK_DESTROY) || - sock_flag(sk, SOCK_DEAD)) { + /* Magic here: If we listen() and a new link dies before it + is accepted() it isn't 'dead' so doesn't get removed. */ + if (!sk || sock_flag(sk, SOCK_DESTROY) || + (sk->sk_state == TCP_LISTEN && + sock_flag(sk, SOCK_DEAD))) { if (sk) { sock_hold(sk); ax25_destroy_socket(ax25);