Change in osmo-bts[master]: oml: fix TL16V length calculation in add_bts_feat()

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
Fri May 29 17:55:59 UTC 2020


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


Change subject: oml: fix TL16V length calculation in add_bts_feat()
......................................................................

oml: fix TL16V length calculation in add_bts_feat()

An additional octet is only needed if total number of features
cannot be devided by 8 without the remainder. Fix this.

Change-Id: Ie501e5a635493830e0597f7b2fa287b6448e660d
---
M src/common/oml.c
1 file changed, 4 insertions(+), 1 deletion(-)



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

diff --git a/src/common/oml.c b/src/common/oml.c
index 077ef09..16b24b1 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -173,7 +173,10 @@
 /* Add BTS features as 3GPP TS 52.021 §9.4.30 Manufacturer Id */
 static inline void add_bts_feat(struct msgb *msg, const struct gsm_bts *bts)
 {
-	msgb_tl16v_put(msg, NM_ATT_MANUF_ID, _NUM_BTS_FEAT/8 + 1, bts->features->data);
+	unsigned int len = _NUM_BTS_FEAT / 8;
+	if (_NUM_BTS_FEAT % 8 != 0)
+		len++;
+	msgb_tl16v_put(msg, NM_ATT_MANUF_ID, len, bts->features->data);
 }
 
 static inline void add_trx_attr(struct msgb *msg, const struct gsm_bts_trx *trx)

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie501e5a635493830e0597f7b2fa287b6448e660d
Gerrit-Change-Number: 18592
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200529/e1f02164/attachment.htm>


More information about the gerrit-log mailing list