[PATCH] osmo-bts[master]: ignore RSL RF CHAN REL for inactive lchans

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Tue May 8 20:15:05 UTC 2018


Review at  https://gerrit.osmocom.org/8078

ignore RSL RF CHAN REL for inactive lchans

When an RF CHANnel RELease request is received on an already released lchan,
there is no "REL NACK" message or similar, we just ACK the release.

When ACKing the release, make sure to reflect the same chan_nr that the release
was asked for, since the lchan state may actually reflect a different chan_nr.

Factor the actual Rel Ack message sending out of rsl_tx_rf_rel_ack(), which
makes all sorts of decisions around normal Rel Ack: add static tx_rf_rel_ack(),
with chan_nr argument instead of deriving chan_nr from the lchan.

Use this to directly ACK an unusual Chan Rel with the chan_nr that came in with
the request.

Fixes: BTS_Tests.TC_dyn_osmo_pdch_unsol_deact
       (after I6b790e866ce4e66d9385b286b727ae41a83d3e67)

Change-Id: Iceaa2e87874ced42d664a2a0b01a1c59e46a19b3
---
M src/common/rsl.c
1 file changed, 29 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/8078/1

diff --git a/src/common/rsl.c b/src/common/rsl.c
index 52eb5f4..a09d3a2 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -613,10 +613,26 @@
  * dedicated channel related messages
  */
 
+/* Send an RF CHANnel RELease ACKnowledge with the given chan_nr. This chan_nr may mismatch the current
+ * lchan state, if we received a CHANnel RELease for an already released channel, and we're just acking
+ * what we got without taking any action. */
+static int tx_rf_rel_ack(struct gsm_lchan *lchan, uint8_t chan_nr)
+{
+	struct msgb *msg;
+
+	msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr));
+	if (!msg)
+		return -ENOMEM;
+
+	rsl_dch_push_hdr(msg, RSL_MT_RF_CHAN_REL_ACK, chan_nr);
+	msg->trx = lchan->ts->trx;
+
+	return abis_bts_rsl_sendmsg(msg);
+}
+
 /* 8.4.19 sending RF CHANnel RELease ACKnowledge */
 int rsl_tx_rf_rel_ack(struct gsm_lchan *lchan)
 {
-	struct msgb *msg;
 	uint8_t chan_nr = gsm_lchan2chan_nr(lchan);
 	bool send_rel_ack;
 
@@ -675,14 +691,7 @@
 	 */
 	lapdm_channel_exit(&lchan->lapdm_ch);
 
-	msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr));
-	if (!msg)
-		return -ENOMEM;
-
-	rsl_dch_push_hdr(msg, RSL_MT_RF_CHAN_REL_ACK, chan_nr);
-	msg->trx = lchan->ts->trx;
-
-	return abis_bts_rsl_sendmsg(msg);
+	return tx_rf_rel_ack(lchan, chan_nr);
 }
 
 /* 8.4.2 sending CHANnel ACTIVation ACKnowledge */
@@ -1187,6 +1196,17 @@
 {
 	int rc;
 
+	if (lchan->state == LCHAN_S_NONE) {
+		LOGP(DRSL, LOGL_ERROR,
+		     "%s ss=%d state=%s Rx RSL RF Channel Release, but is already inactive;"
+		     " just ACKing the release\n",
+		     gsm_ts_and_pchan_name(lchan->ts), lchan->nr,
+		     gsm_lchans_name(lchan->state));
+		/* Just ack the release and ignore. Make sure to reflect the same chan_nr we received,
+		 * not necessarily reflecting the current lchan state. */
+		return tx_rf_rel_ack(lchan, chan_nr);
+	}
+
 	if (lchan->abis_ip.rtp_socket) {
 		rsl_tx_ipac_dlcx_ind(lchan, RSL_ERR_NORMAL_UNSPEC);
 		osmo_rtp_socket_log_stats(lchan->abis_ip.rtp_socket, DRTP, LOGL_INFO,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iceaa2e87874ced42d664a2a0b01a1c59e46a19b3
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list