Change in osmo-bsc[master]: abis_nm: fix length indicator in Set Channel Attributes

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
Mon Jun 15 13:41:52 UTC 2020


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


Change subject: abis_nm: fix length indicator in Set Channel Attributes
......................................................................

abis_nm: fix length indicator in Set Channel Attributes

Change-Id: I948ad4b847921324794a6eabd95d5583324da6e4
Related: OS#4545
---
M src/osmo-bsc/abis_nm.c
1 file changed, 6 insertions(+), 5 deletions(-)



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

diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index d503f2a..b6d1ec5 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -1998,14 +1998,11 @@
 	struct abis_om_fom_hdr *foh;
 	uint8_t zero = 0x00;
 	struct msgb *msg = nm_msgb_alloc();
-	uint8_t len = 2 + 2;
 	const char *reason = NULL;
 
-	if (bts->type == GSM_BTS_TYPE_BS11)
-		len += 4 + 2 + 2 + 3;
-
+	/* NOTE: message length will be set later, see down below */
 	oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE);
-	foh = fill_om_fom_hdr(oh, len, NM_MT_SET_CHAN_ATTR, NM_OC_CHANNEL, bts->bts_nr,
+	foh = fill_om_fom_hdr(oh, 0, NM_MT_SET_CHAN_ATTR, NM_OC_CHANNEL, bts->bts_nr,
 			      ts->trx->nr, ts->nr);
 
 	DEBUGPFOH(DNM, foh, "Set Chan Attr %s\n", gsm_ts_name(ts));
@@ -2061,6 +2058,10 @@
 	if (bts->type == GSM_BTS_TYPE_BS11)
 		msgb_tlv_put(msg, 0x59, 1, &zero);
 
+	msg->l2h = (uint8_t *) oh;
+	msg->l3h = (uint8_t *) foh;
+	oh->length = msgb_l3len(msg);
+
 	DEBUGPFOH(DNM, foh, "%s(): sending %s\n", __func__, msgb_hexdump(msg));
 	return abis_nm_sendmsg(bts, msg);
 }

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I948ad4b847921324794a6eabd95d5583324da6e4
Gerrit-Change-Number: 18829
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/20200615/82c635e8/attachment.htm>


More information about the gerrit-log mailing list