hc
2024-10-09 05e59e5fb0064c97a1c10921ecd549f2d4a58565
kernel/net/ax25/ax25_subr.c
....@@ -1,8 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
2
- * This program is free software; you can redistribute it and/or modify
3
- * it under the terms of the GNU General Public License as published by
4
- * the Free Software Foundation; either version 2 of the License, or
5
- * (at your option) any later version.
63 *
74 * Copyright (C) Alan Cox GW4PTS (alan@lxorguk.ukuu.org.uk)
85 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
....@@ -264,12 +261,20 @@
264261 {
265262 ax25_clear_queues(ax25);
266263
267
- if (!ax25->sk || !sock_flag(ax25->sk, SOCK_DESTROY))
268
- ax25_stop_heartbeat(ax25);
269
- ax25_stop_t1timer(ax25);
270
- ax25_stop_t2timer(ax25);
271
- ax25_stop_t3timer(ax25);
272
- ax25_stop_idletimer(ax25);
264
+ if (reason == ENETUNREACH) {
265
+ del_timer_sync(&ax25->timer);
266
+ del_timer_sync(&ax25->t1timer);
267
+ del_timer_sync(&ax25->t2timer);
268
+ del_timer_sync(&ax25->t3timer);
269
+ del_timer_sync(&ax25->idletimer);
270
+ } else {
271
+ if (!ax25->sk || !sock_flag(ax25->sk, SOCK_DESTROY))
272
+ ax25_stop_heartbeat(ax25);
273
+ ax25_stop_t1timer(ax25);
274
+ ax25_stop_t2timer(ax25);
275
+ ax25_stop_t3timer(ax25);
276
+ ax25_stop_idletimer(ax25);
277
+ }
273278
274279 ax25->state = AX25_STATE_0;
275280