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

Ivan Kluchnikov gerrit-no-reply at lists.osmocom.org
Thu Feb 9 16:05:38 UTC 2017


Review at  https://gerrit.osmocom.org/1783

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,
when type of abis_nm_att_tlvdef_ipa was changed from struct tlv_definition to const struct tlv_definition.
The following solution is proposed:
 * 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, 8 insertions(+), 2 deletions(-)


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

diff --git a/src/common/oml.c b/src/common/oml.c
index 272123e..55c54e5 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -46,13 +46,18 @@
 
 static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg);
 
+static struct tlv_definition abis_nm_att_tlvdef_ipa_local = {
+    .def = {
+    },
+};
+
 /*
  * 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 +1252,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: newchange
Gerrit-Change-Id: Ia9f3c94ab247adeecb26a01c3ccd6f3a8c17ba1c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Ivan Kluchnikov <kluchnikovi at gmail.com>


More information about the gerrit-log mailing list