Change in osmo-bts[master]: osmo-bts-trx: discard TRXD PDUs with unexpected version

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

fixeria gerrit-no-reply at lists.osmocom.org
Tue Apr 20 23:05:21 UTC 2021


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


Change subject: osmo-bts-trx: discard TRXD PDUs with unexpected version
......................................................................

osmo-bts-trx: discard TRXD PDUs with unexpected version

Change-Id: Icdc3d12a7686428046113f9fa8f21a99569e651a
Related: SYS#4895, OS#4941, OS#4006
---
M src/osmo-bts-trx/trx_if.c
1 file changed, 11 insertions(+), 1 deletion(-)



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

diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index e51b2e0..a528599 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -945,8 +945,18 @@
 	/* Pre-clean (initialize) the flags */
 	bi.flags = 0x00;
 
-	/* Parse header depending on the PDU version */
+	/* Parse PDU version first */
 	pdu_ver = buf[0] >> 4;
+
+	/* Make sure that PDU version matches our expectations */
+	if (pdu_ver != l1h->config.trxd_pdu_ver_use) {
+		LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,
+			"Rx TRXD PDU with unexpected version %u (expected %u)\n",
+			pdu_ver, l1h->config.trxd_pdu_ver_use);
+		return -EIO;
+	}
+
+	/* Parse header depending on the PDU version */
 	switch (pdu_ver) {
 	case 0:
 		/* Legacy protocol has no version indicator */

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Icdc3d12a7686428046113f9fa8f21a99569e651a
Gerrit-Change-Number: 23829
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/20210420/8d2fc229/attachment.htm>


More information about the gerrit-log mailing list