From 909212fc878bcb1bdedc52ee2dbf57192efaae96 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 13 Feb 2011 15:42:07 +0100 Subject: LAPD: Make sure we don't re-start SABM timer for INACTIVE SAPs --- openbsc/src/input/lapd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openbsc/src/input/lapd.c b/openbsc/src/input/lapd.c index 1212fb369..9bfc2cb4a 100644 --- a/openbsc/src/input/lapd.c +++ b/openbsc/src/input/lapd.c @@ -601,7 +601,8 @@ static void sabme_timer_cb(void *_sap) lapd_send_sabm(sap->tei->li, sap->tei->tei, sap->sapi); - bsc_schedule_timer(&sap->sabme_timer, SABM_INTERVAL); + if (sap->state == SAP_STATE_SABM_RETRANS) + bsc_schedule_timer(&sap->sabme_timer, SABM_INTERVAL); } /* Start a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */ @@ -639,7 +640,7 @@ int lapd_sap_stop(struct lapd_instance *li, uint8_t tei, uint8_t sapi) if (!sap) return -ENODEV; - bsc_del_timer(&sap->sabme_timer); + lapd_sap_set_state(teip, sapi, SAP_STATE_INACTIVE); llist_del(&sap->list); talloc_free(sap); -- cgit v1.2.3