aboutsummaryrefslogtreecommitdiffstats
path: root/src/libbsc/e1_config.c
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-02-12 14:28:52 +0100
committerStefan Sperling <ssperling@sysmocom.de>2018-02-13 18:08:28 +0100
commit73acbca50fe109bcd58f90c1a282b0c75a81b97b (patch)
tree7e5186a7d992dcae24a429e1c42d3252ac8bb1d5 /src/libbsc/e1_config.c
parentaa4adb8fbf9bd66ec6d628250ffe1a4106a9724d (diff)
Make RSL connection attempts time out.
If a BTS/TRX does not respond to the "IPA RSL Connect" command, pretend that the BTS has sent a NACK for the connection. To ensure that osmo_timer_del(&trx->rsl_connection_timeout) is not called before this timer is initialized with osmo_timer_setup(), the E1 layer now drops incoming RSL messages from a BTS/TRX in LOCKED administrative state. We cancel the timeout if we receive an RSL Connect ACK or NACK from the BTS, and if the underlying E1 link does down. While here, add a missing message buffer free() in bts_isdn_sign_link(). The callers do not free it. Change-Id: Ia72b65a0f15f47dcb8a6f944f6c3695a4a64b923 Related: OS#2716
Diffstat (limited to 'src/libbsc/e1_config.c')
-rw-r--r--src/libbsc/e1_config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libbsc/e1_config.c b/src/libbsc/e1_config.c
index 90e29d3cf..e7398ed9c 100644
--- a/src/libbsc/e1_config.c
+++ b/src/libbsc/e1_config.c
@@ -131,10 +131,17 @@ static int bts_isdn_sign_link(struct msgb *msg)
ret = bts->model->oml_rcvmsg(msg);
break;
case E1INP_SIGN_RSL:
+ if (link->trx->mo.nm_state.administrative == NM_STATE_LOCKED) {
+ LOGP(DLMI, LOGL_ERROR, "(bts=%d/trx=%d) discarding RSL message received "
+ "in locked administrative state\n", link->trx->bts->nr, link->trx->nr);
+ msgb_free(msg);
+ break;
+ }
ret = abis_rsl_rcvmsg(msg);
break;
default:
LOGP(DLMI, LOGL_ERROR, "unknown link type %u\n", link->type);
+ msgb_free(msg);
break;
}
return ret;