[PATCH] osmo-bts[master]: oml: Fix incorrect usage of const variable abis_nm_att_tlvde...

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Sun Feb 19 14:43:04 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/1783

to look at the new patch set (#3).

oml: Fix incorrect usage of const variable abis_nm_att_tlvdef_ipa

This bug was introduced during moving oml definitions from osmo-bts to libosmocore
in libosmocore 0bee65c0d89f81a4b90aa3d484016d9ba680dd46 and
osmo-bts 2cf6b73a4278627331bdbbb4addf1a8bc1d964ce:

The type of abis_nm_att_tlvdef_ipa was changed from struct tlv_definition to
const struct tlv_definition, so:
 * create static abis_nm_att_tlvdef_ipa_local variable for oml attribute
   definitions
 * copy abis_nm_att_tlvdef_ipa to abis_nm_att_tlvdef_ipa_local
 * merge abis_nm_att_tlvdef with abis_nm_att_tlvdef_ipa_local
 * use abis_nm_att_tlvdef_ipa_local in oml_tlv_parse function

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/83/1783/3

diff --git a/src/common/oml.c b/src/common/oml.c
index 272123e..7069377 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -46,13 +46,15 @@
 
 static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg);
 
+static struct tlv_definition abis_nm_att_tlvdef_ipa_local = {};
+
 /*
  * support
  */
 
 static int oml_tlv_parse(struct tlv_parsed *tp, const uint8_t *buf, int len)
 {
-	return tlv_parse(tp, &abis_nm_att_tlvdef_ipa, buf, len, 0, 0);
+	return tlv_parse(tp, &abis_nm_att_tlvdef_ipa_local, buf, len, 0, 0);
 }
 
 struct msgb *oml_msgb_alloc(void)
@@ -1247,7 +1249,8 @@
 int oml_init(struct gsm_abis_mo *mo)
 {
 	DEBUGP(DOML, "Initializing OML attribute definitions\n");
-	tlv_def_patch(&abis_nm_att_tlvdef_ipa, &abis_nm_att_tlvdef);
+	tlv_def_patch(&abis_nm_att_tlvdef_ipa_local, &abis_nm_att_tlvdef_ipa);
+	tlv_def_patch(&abis_nm_att_tlvdef_ipa_local, &abis_nm_att_tlvdef);
 	osmo_signal_register_handler(SS_FAIL, handle_fail_sig, mo);
 
 	return 0;

-- 
To view, visit https://gerrit.osmocom.org/1783
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia9f3c94ab247adeecb26a01c3ccd6f3a8c17ba1c
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Ivan Kluchnikov <kluchnikovi at gmail.com>
Gerrit-Reviewer: Alexander Chemeris <Alexander.Chemeris at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnikovi at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>


More information about the gerrit-log mailing list