Change in osmo-bsc[master]: gsm0408_rcvmsg: Release lchan if L3 fails to complete

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon Nov 5 15:24:07 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/11606


Change subject: gsm0408_rcvmsg: Release lchan if L3 fails to complete
......................................................................

gsm0408_rcvmsg: Release lchan if L3 fails to complete

Change-Id: I1743f9d5cd0fdbc0fb9afe7bcc0271c897915210
---
M src/osmo-bsc/gsm_04_08_rr.c
M tests/gsm0408/gsm0408_test.c
2 files changed, 10 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/06/11606/1

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 @@
 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 @@
 		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 @@
 	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;

-- 
To view, visit https://gerrit.osmocom.org/11606
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1743f9d5cd0fdbc0fb9afe7bcc0271c897915210
Gerrit-Change-Number: 11606
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181105/f46812fa/attachment.htm>


More information about the gerrit-log mailing list