aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-10-21 13:05:44 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-10-21 13:26:09 +0200
commitea369095db762931e57f0a4cd3472647791ca831 (patch)
treef9a4855a8fc33e112f202139b37860d3232e04f4
parent7998a54cf93bb701bd051bb7a77feb68b903fe39 (diff)
lapdm: Allow SABM L=0 in Timer Recovery Statepespin/lapdm
3GPP TS 44.006 8.6.3 "Procedures for re-establishment" is quite explicit: """ When the data link layer receives in the multiple frame established state or !!!timer recovery state!!! a DL-ESTABLISH- REQUEST primitive from layer 3 or an SABM (with L=0), the normal establishment procedure of sub-clause 8.4.1.2 shall be initiated. """ If L>0 in that state, send a DM as stated in 8.4.1.2: """ If the data link layer entity is unable to enter the multiple-frame-established state, it shall respond to the SABM command with a DM response with the F bit set to the same binary value as the P bit in the received SABM command. """ Related: OS#4549 Related: OS#4819 Change-Id: I7959dc39f883cd5c56c36a21176a2401838d7b62
-rw-r--r--src/gsm/lapd_core.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c
index bcb64b0e..ed0b3209 100644
--- a/src/gsm/lapd_core.c
+++ b/src/gsm/lapd_core.c
@@ -849,6 +849,23 @@ static int lapd_rx_u_sabm(struct msgb *msg, struct lapd_msg_ctx *lctx)
switch (dl->state) {
case LAPD_STATE_IDLE:
break;
+ case LAPD_STATE_TIMER_RECOV:
+ LOGDL(dl, LOGL_INFO, "SABM command, timer recovery state\n");
+ /* If link is lost on the remote side, we start over
+ * and send DL-ESTABLISH indication again. */
+ /* 3GPP TS 44.006 8.6.3 "Procedures for re-establishment" */
+ if (length) {
+ /* check for contention resoultion */
+ LOGDL(dl, LOGL_ERROR, "SABM L>0 not expected in timer "
+ "recovery state\n");
+ mdl_error(MDL_CAUSE_SABM_INFO_NOTALL, lctx);
+ lapd_send_dm(lctx);
+ msgb_free(msg);
+ return 0;
+ }
+ /* re-establishment, continue below */
+ lapd_stop_t200(dl);
+ break;
case LAPD_STATE_MF_EST:
LOGDL(dl, LOGL_INFO, "SABM command, multiple frame established state\n");
/* If link is lost on the remote side, we start over