.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
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. |
---|
6 | 3 | * |
---|
7 | 4 | * Copyright (C) Alan Cox GW4PTS (alan@lxorguk.ukuu.org.uk) |
---|
8 | 5 | * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) |
---|
.. | .. |
---|
264 | 261 | { |
---|
265 | 262 | ax25_clear_queues(ax25); |
---|
266 | 263 | |
---|
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 | + } |
---|
273 | 278 | |
---|
274 | 279 | ax25->state = AX25_STATE_0; |
---|
275 | 280 | |
---|