aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Kluchnikov <kluchnikovi@gmail.com>2017-02-09 19:03:11 +0300
committerIvan Kluchnikov <kluchnikovi@gmail.com>2017-02-16 19:04:34 +0300
commita53e3a547299b202235afad9801acacd5cfe4acd (patch)
treea386c53a3a31ae1b2b14ef38631b617f216ba9a5
parent6b4c6aa375bfe1d49594d8a43345dc6b5df917c3 (diff)
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
-rw-r--r--src/common/oml.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/common/oml.c b/src/common/oml.c
index 272123e6..55c54e57 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 @@ static int handle_fail_sig(unsigned int subsys, unsigned int signal, void *handl
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;