Change in osmo-bts[master]: rsl: Send RSL Error Report in case of unknown/unsupported msg_type

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun May 19 12:18:53 UTC 2019


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/14083


Change subject: rsl: Send RSL Error Report in case of unknown/unsupported msg_type
......................................................................

rsl: Send RSL Error Report in case of unknown/unsupported msg_type

Send an RSL Error Report in case of unknown/unsupported msg_type,
as describedi in section 7.3 of 3GPP TS 48.058.

Related: OS#3789
Change-Id: Ib2918007410e635b144a7535cec30b9f3378c755
---
M src/common/rsl.c
1 file changed, 14 insertions(+), 1 deletion(-)



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

diff --git a/src/common/rsl.c b/src/common/rsl.c
index c2a7db6..1be6e52 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2523,7 +2523,9 @@
 static int rsl_rx_rll(struct gsm_bts_trx *trx, struct msgb *msg)
 {
 	struct abis_rsl_rll_hdr *rh = msgb_l2(msg);
+	struct abis_rsl_rll_hdr rh2;
 	struct gsm_lchan *lchan;
+	int rc;
 
 	if (msgb_l2len(msg) < sizeof(*rh)) {
 		LOGP(DRSL, LOGL_NOTICE, "RSL Radio Link Layer message too short\n");
@@ -2546,9 +2548,14 @@
 	DEBUGP(DRLL, "%s Rx RLL %s Abis -> LAPDm\n", gsm_lchan_name(lchan),
 		rsl_msg_name(rh->c.msg_type));
 
+	/* make copy of RLL header, as the message will be free'd in case of erroneous return */
+	rh2 = *rh;
 	/* exception: RLL messages are _NOT_ freed as they are now
 	 * owned by LAPDm which might have queued them */
-	return lapdm_rslms_recvmsg(msg, &lchan->lapdm_ch);
+	rc = lapdm_rslms_recvmsg(msg, &lchan->lapdm_ch);
+	if (rc < 0)
+		rsl_tx_error_report(trx, RSL_ERR_MSG_TYPE, &rh2.chan_nr, &rh2.link_id, NULL);
+	return rc;
 }
 
 static inline int rsl_link_id_is_sacch(uint8_t link_id)
@@ -2823,10 +2830,12 @@
 	case RSL_MT_NOT_CMD:
 		LOGP(DRSL, LOGL_NOTICE, "unimplemented RSL cchan msg_type %s\n",
 			rsl_msg_name(cch->c.msg_type));
+		rsl_tx_error_report(trx, RSL_ERR_MSG_TYPE, &cch->chan_nr, NULL, msg);
 		break;
 	default:
 		LOGP(DRSL, LOGL_NOTICE, "undefined RSL cchan msg_type 0x%02x\n",
 			cch->c.msg_type);
+		rsl_tx_error_report(trx, RSL_ERR_MSG_TYPE, &cch->chan_nr, NULL, msg);
 		ret = -EINVAL;
 		break;
 	}
@@ -2898,10 +2907,12 @@
 	case RSL_MT_TFO_MOD_REQ:
 		LOGP(DRSL, LOGL_NOTICE, "unimplemented RSL dchan msg_type %s\n",
 			rsl_msg_name(dch->c.msg_type));
+		rsl_tx_error_report(trx, RSL_ERR_MSG_TYPE, &dch->chan_nr, NULL, msg);
 		break;
 	default:
 		LOGP(DRSL, LOGL_NOTICE, "undefined RSL dchan msg_type 0x%02x\n",
 			dch->c.msg_type);
+		rsl_tx_error_report(trx, RSL_ERR_MSG_TYPE, &dch->chan_nr, NULL, msg);
 		ret = -EINVAL;
 	}
 
@@ -2931,6 +2942,7 @@
 	default:
 		LOGP(DRSL, LOGL_NOTICE, "undefined RSL TRX msg_type 0x%02x\n",
 			th->msg_type);
+		rsl_tx_error_report(trx, RSL_ERR_MSG_TYPE, NULL, NULL, msg);
 		ret = -EINVAL;
 	}
 
@@ -2977,6 +2989,7 @@
 	default:
 		LOGP(DRSL, LOGL_NOTICE, "unsupported RSL ip.access msg_type 0x%02x\n",
 			dch->c.msg_type);
+		rsl_tx_error_report(trx, RSL_ERR_MSG_TYPE, &dch->chan_nr, NULL, msg);
 		ret = -EINVAL;
 	}
 

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2918007410e635b144a7535cec30b9f3378c755
Gerrit-Change-Number: 14083
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190519/2a508b46/attachment.htm>


More information about the gerrit-log mailing list