aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm/lapd_core.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2016-12-08 10:45:06 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2017-02-07 13:39:01 +0100
commitd9f6129350bc79e803861f92e99dbf72e44b1ea3 (patch)
tree4c71b8c652ab6ff06b38fac1d08096584aee7be8 /src/gsm/lapd_core.c
parentb288853ffa01fbce1f5831ae6d387520c8882aec (diff)
lapd_core: fix program flow
when the lapd core is in state LAPD_STATE_SABM_SENT, and the retransmission counter exceeds (link down) lapd_t200_cb() will send an RELASE_INDICATION and an MDL_ERROR_INDICATION to L3. This action is done before the state is processed. This seems to be no problem with standard retransmission counts (n200), but may cause timing problems that lead to deadlock states when custom timer configurations are in use. (Ericsson RBS). This commit moves the functions calls for sending the indications mentioned above to the very end of the if branch to relax the timing again. (See lapd_t200_cb()) Change-Id: I1c1beb3701b19744a3ce9946abca7767d20a0b6a
Diffstat (limited to 'src/gsm/lapd_core.c')
-rw-r--r--src/gsm/lapd_core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c
index 84b1828d..5af82aa2 100644
--- a/src/gsm/lapd_core.c
+++ b/src/gsm/lapd_core.c
@@ -556,11 +556,6 @@ static void lapd_t200_cb(void *data)
case LAPD_STATE_SABM_SENT:
/* 5.4.1.3 */
if (dl->retrans_ctr + 1 >= dl->n200_est_rel + 1) {
- /* send RELEASE INDICATION to L3 */
- send_dl_simple(PRIM_DL_REL, PRIM_OP_INDICATION,
- &dl->lctx);
- /* send MDL ERROR INIDCATION to L3 */
- mdl_error(MDL_CAUSE_T200_EXPIRED, &dl->lctx);
/* flush tx and send buffers */
lapd_dl_flush_tx(dl);
lapd_dl_flush_send(dl);
@@ -569,6 +564,11 @@ static void lapd_t200_cb(void *data)
/* NOTE: we must not change any other states or buffers
* and queues, since we may reconnect after handover
* failure. the buffered messages is replaced there */
+ /* send RELEASE INDICATION to L3 */
+ send_dl_simple(PRIM_DL_REL, PRIM_OP_INDICATION,
+ &dl->lctx);
+ /* send MDL ERROR INIDCATION to L3 */
+ mdl_error(MDL_CAUSE_T200_EXPIRED, &dl->lctx);
break;
}
/* retransmit SABM command */