aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-11-05 13:58:32 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-11-05 14:04:18 +0100
commit3b6e1511e7c1e34a2c020cc8920f6fe5d840f5d7 (patch)
tree778f3c2e51686b876c96a9111b315a4a2931b796
parent91650b0b4c680ac6f4b71c00b6dc151bce92851a (diff)
gsm0408_rcvmsg: Release lchan if L3 fails to completepespin/bsc-no-subscr
-rw-r--r--src/osmo-bsc/gsm_04_08_rr.c7
-rw-r--r--tests/gsm0408/gsm0408_test.c4
2 files changed, 10 insertions, 1 deletions
diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c
index 4659c1a..0f72ab7 100644
--- a/src/osmo-bsc/gsm_04_08_rr.c
+++ b/src/osmo-bsc/gsm_04_08_rr.c
@@ -927,6 +927,7 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn,
int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id)
{
struct gsm_lchan *lchan;
+ int rc;
lchan = msg->lchan;
if (!lchan_may_receive_data(lchan)) {
@@ -948,7 +949,11 @@ int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id)
lchan->conn->lchan = lchan;
/* fwd via bsc_api to send COMPLETE L3 INFO to MSC */
- bsc_compl_l3(lchan->conn, msg, 0);
+ rc = bsc_compl_l3(lchan->conn, msg, 0);
+ if (rc < 0) {
+ gscon_release_lchans(lchan->conn, false);
+ return -1;
+ }
/* conn shall release lchan on teardown, also if this Layer 3 Complete is rejected. */
}
diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index faeca39..8906e5b 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -952,6 +952,10 @@ struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *ne
OSMO_ASSERT(0);
}
+void gscon_release_lchans(struct gsm_subscriber_connection *conn, bool do_sacch_deact) {
+ OSMO_ASSERT(0);
+}
+
bool on_gsm_ts_init(struct gsm_bts_trx_ts *ts)
{
return true;