Change in osmo-bts[master]: OML: correct parse the NM_ATT_OSMO_NS_LINK_CFG field address_family

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

laforge gerrit-no-reply at lists.osmocom.org
Thu Oct 8 06:55:32 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/20479 )

Change subject: OML: correct parse the NM_ATT_OSMO_NS_LINK_CFG field address_family
......................................................................

OML: correct parse the NM_ATT_OSMO_NS_LINK_CFG field address_family

The address_family is 8 bit and have a padding byte afterwards.
By using osmo_load16be it's encoding it wrong and result in an
empty/invalid NSVC configuration.

Change-Id: Ie070b5745124d48e74a6dedd8903b74bfb3ce9d2
---
M src/common/oml.c
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/oml.c b/src/common/oml.c
index 1f74cac..5394e8a 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1277,12 +1277,13 @@
 
 	if (TLVP_PRES_LEN(tp, NM_ATT_OSMO_NS_LINK_CFG, 10)) {
 		const uint8_t *cur = TLVP_VAL(tp, NM_ATT_OSMO_NS_LINK_CFG);
-		uint16_t address_family;
+		uint8_t address_family;
 
 		memset(&nsvc->local, 0, sizeof(nsvc->local));
 		memset(&nsvc->remote, 0, sizeof(nsvc->remote));
 
-		address_family = osmo_load16be(cur);
+		address_family = *cur;
+		/* 1byte padding */
 		cur += 2;
 
 		memcpy(&nsvc->local.u.sin.sin_port, cur, 2);

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie070b5745124d48e74a6dedd8903b74bfb3ce9d2
Gerrit-Change-Number: 20479
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201008/6c1da012/attachment.htm>


More information about the gerrit-log mailing list