Change in osmo-bts[master]: rsl: do not blindly ignore unhandled/unknown Channel Mode

fixeria gerrit-no-reply at lists.osmocom.org
Fri Apr 16 18:57:14 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/23780 )


Change subject: rsl: do not blindly ignore unhandled/unknown Channel Mode
......................................................................

rsl: do not blindly ignore unhandled/unknown Channel Mode

Change-Id: I67a70132999be6580a29e6b814763309a6df4ae9
Related: SYS#4895
---
M src/common/rsl.c
1 file changed, 14 insertions(+), 4 deletions(-)



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

diff --git a/src/common/rsl.c b/src/common/rsl.c
index 525b637..8488ab7 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -112,8 +112,8 @@
 }
 
 /* compute lchan->rsl_cmode and lchan->tch_mode from RSL CHAN MODE IE */
-static void lchan_tchmode_from_cmode(struct gsm_lchan *lchan,
-				     struct rsl_ie_chan_mode *cm)
+static int lchan_tchmode_from_cmode(struct gsm_lchan *lchan,
+				    const struct rsl_ie_chan_mode *cm)
 {
 	lchan->rsl_cmode = cm->spd_ind;
 	lchan->ts->trx->bts->dtxd = (cm->dtx_dtu & RSL_CMOD_DTXd) ? true : false;
@@ -137,7 +137,11 @@
 	case RSL_CMOD_SP_NT_6k0:
 		lchan->tch_mode = GSM48_CMODE_DATA_6k0;
 		break;
+	default:
+		return -ENOTSUP;
 	}
+
+	return 0;
 }
 
 
@@ -1359,7 +1363,10 @@
 			return rsl_tx_chan_act_nack(lchan, RSL_ERR_MAND_IE_ERROR);
 		}
 		cm = (struct rsl_ie_chan_mode *) TLVP_VAL(&tp, RSL_IE_CHAN_MODE);
-		lchan_tchmode_from_cmode(lchan, cm);
+		if (lchan_tchmode_from_cmode(lchan, cm) != 0) {
+			LOGPLCHAN(lchan, DRSL, LOGL_NOTICE, "Unhandled RSL Channel Mode\n");
+			return rsl_tx_chan_act_nack(lchan, RSL_ERR_IE_CONTENT);
+		}
 	}
 
 	/* 9.3.7 Encryption Information */
@@ -1874,7 +1881,10 @@
 		return rsl_tx_mode_modif_nack(lchan, RSL_ERR_MAND_IE_ERROR);
 	}
 	cm = (struct rsl_ie_chan_mode *) TLVP_VAL(&tp, RSL_IE_CHAN_MODE);
-	lchan_tchmode_from_cmode(lchan, cm);
+	if (lchan_tchmode_from_cmode(lchan, cm) != 0) {
+		LOGPLCHAN(lchan, DRSL, LOGL_NOTICE, "Unhandled RSL Channel Mode\n");
+		return rsl_tx_mode_modif_nack(lchan, RSL_ERR_IE_CONTENT);
+	}
 
 	if (bts_supports_cm(lchan->ts->trx->bts, ts_pchan(lchan->ts), lchan->tch_mode) != 1) {
 		LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "%s: invalid mode: %s (wrong BSC configuration?)\n",

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/23780
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I67a70132999be6580a29e6b814763309a6df4ae9
Gerrit-Change-Number: 23780
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210416/8496d9e4/attachment.htm>


More information about the gerrit-log mailing list