[MERGED] libosmocore[master]: lapd_core: fix program flow

dexter gerrit-no-reply at lists.osmocom.org
Tue Feb 7 13:54:00 UTC 2017


dexter has submitted this change and it was merged.

Change subject: lapd_core: fix program flow
......................................................................


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
---
M src/gsm/lapd_core.c
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c
index 84b1828..5af82aa 100644
--- a/src/gsm/lapd_core.c
+++ b/src/gsm/lapd_core.c
@@ -556,11 +556,6 @@
 	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 @@
 			/* 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 */

-- 
To view, visit https://gerrit.osmocom.org/1726
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1c1beb3701b19744a3ce9946abca7767d20a0b6a
Gerrit-PatchSet: 4
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>


More information about the gerrit-log mailing list