[PATCH] osmo-bts[master]: RSL: Send ERROR REPORT on too short/truncated messages + wro...

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
Sat Feb 24 03:36:03 UTC 2018


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

RSL: Send ERROR REPORT on too short/truncated messages + wrong discriminator

Change-Id: I6a0e63999f39592474064e2f05df450aec8e37fe
---
M src/common/rsl.c
1 file changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/src/common/rsl.c b/src/common/rsl.c
index 2638ad2..bffe69d 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2276,6 +2276,7 @@
 
 	if (msgb_l2len(msg) < sizeof(*rh)) {
 		LOGP(DRSL, LOGL_NOTICE, "RSL Radio Link Layer message too short\n");
+		rsl_tx_error_report(trx, RSL_ERR_PROTO);
 		msgb_free(msg);
 		return -EIO;
 	}
@@ -2469,6 +2470,7 @@
 
 	if (msgb_l2len(msg) < sizeof(*cch)) {
 		LOGP(DRSL, LOGL_NOTICE, "RSL Common Channel Management message too short\n");
+		rsl_tx_error_report(trx, RSL_ERR_PROTO);
 		msgb_free(msg);
 		return -EIO;
 	}
@@ -2598,6 +2600,7 @@
 
 	if (msgb_l2len(msg) < sizeof(*th)) {
 		LOGP(DRSL, LOGL_NOTICE, "RSL TRX message too short\n");
+		rsl_tx_error_report(trx, RSL_ERR_PROTO);
 		msgb_free(msg);
 		return -EIO;
 	}
@@ -2626,6 +2629,7 @@
 
 	if (msgb_l2len(msg) < sizeof(*dch)) {
 		LOGP(DRSL, LOGL_NOTICE, "RSL ip.access message too short\n");
+		rsl_tx_error_report(trx, RSL_ERR_PROTO);
 		msgb_free(msg);
 		return -EIO;
 	}
@@ -2683,6 +2687,7 @@
 
 	if (msgb_l2len(msg) < sizeof(*rslh)) {
 		LOGP(DRSL, LOGL_NOTICE, "RSL message too short\n");
+		rsl_tx_error_report(trx, RSL_ERR_PROTO);
 		msgb_free(msg);
 		return -EIO;
 	}
@@ -2708,6 +2713,7 @@
 	default:
 		LOGP(DRSL, LOGL_NOTICE, "unknown RSL msg_discr 0x%02x\n",
 			rslh->msg_discr);
+		rsl_tx_error_report(trx, RSL_ERR_MSG_DISCR);
 		msgb_free(msg);
 		ret = -EINVAL;
 	}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a0e63999f39592474064e2f05df450aec8e37fe
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list