Change in osmo-bts[master]: oml: fix handling of NM_ATT_INTERF_BOUND attribute

fixeria gerrit-no-reply at lists.osmocom.org
Wed Jun 16 17:51:27 UTC 2021


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


Change subject: oml: fix handling of NM_ATT_INTERF_BOUND attribute
......................................................................

oml: fix handling of NM_ATT_INTERF_BOUND attribute

Looks like this part of the code has never been tested.  The old
code would dereference the same value in the loop and assign it
to all members in array 'bts->interference.boundary'.

Let's simply memcpy() the contents of NM_ATT_INTERF_BOUND as is,
i.e. 6 unsigned values encoded as -x dBm.

Change-Id: I7f83d8e6eb6cc19e3e9529ba06617a902de23e35
Related: SYS#5313, OS#1569
---
M include/osmo-bts/bts.h
M src/common/oml.c
2 files changed, 5 insertions(+), 6 deletions(-)



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

diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index 978a548..0e04788 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -234,7 +234,7 @@
 
 	struct {
 		/* Interference Boundaries for OML */
-		int16_t boundary[6];
+		uint8_t boundary[6];
 		uint8_t intave;
 	} interference;
 	unsigned int t200_ms[7];
diff --git a/src/common/oml.c b/src/common/oml.c
index 8b84f85..b99f3d4 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -584,11 +584,10 @@
 
 	/* 9.4.25 Interference Level Boundaries */
 	if (TLVP_PRES_LEN(&tp, NM_ATT_INTERF_BOUND, 6)) {
-		payload = TLVP_VAL(&tp, NM_ATT_INTERF_BOUND);
-		for (i = 0; i < 6; i++) {
-			int16_t boundary = *payload;
-			bts->interference.boundary[i] = -1 * boundary;
-		}
+		/* Copy the values as is, in -x dBm */
+		memcpy(&bts->interference.boundary[0],
+		       TLVP_VAL(&tp, NM_ATT_INTERF_BOUND),
+		       sizeof(bts->interference.boundary));
 	}
 	/* 9.4.24 Intave Parameter */
 	if (TLVP_PRES_LEN(&tp, NM_ATT_INTAVE_PARAM, 1))

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I7f83d8e6eb6cc19e3e9529ba06617a902de23e35
Gerrit-Change-Number: 24706
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/20210616/c423a16c/attachment.htm>


More information about the gerrit-log mailing list