aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2023-09-17 04:43:26 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2023-09-19 21:09:25 +0700
commitfaf7592bf56231b76e6ad550f477a70aacd54b93 (patch)
treeabd507d585f0e9a53bdeb9b793fd0db23b13a103
parentfc2fb0d1a49c6ba2b9ca75d7c01885fa5228979b (diff)
oml: ipacc: add missing is_ipa_abisip_bts() checks
These functions are called from a signal handler (SS_NM), and the signal itself is sent from the generic OML logic whenever the Software Activated Report is received from some BTS, which is not necessarily a nanoBTS or osmo-bts. It would be nice if we could check the BTS type once in the signal handler, but the signal data is not always the same and depends on the signal type, so unfortunately it's not possible. Change-Id: I088ff75f2048e54e4bfd926a79c1dcf27b4fb3a4
-rw-r--r--src/osmo-bsc/bts_ipaccess_nanobts.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts.c b/src/osmo-bsc/bts_ipaccess_nanobts.c
index 24966a73d..d99489b61 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts.c
@@ -235,6 +235,9 @@ static void nm_rx_opstart_ack(struct msgb *oml_msg)
struct gsm_bts *bts = sign_link->trx->bts;
struct gsm_abis_mo *mo;
+ if (!is_ipa_abisip_bts(bts))
+ return;
+
mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst);
if (mo == NULL)
LOGPFOH(DNM, LOGL_ERROR, foh, "Rx OPSTART ACK for non-existent MO\n");
@@ -249,6 +252,9 @@ static void nm_rx_opstart_nack(struct msgb *oml_msg)
struct gsm_bts *bts = sign_link->trx->bts;
struct gsm_abis_mo *mo;
+ if (!is_ipa_abisip_bts(bts))
+ return;
+
mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst);
if (mo == NULL)
LOGPFOH(DNM, LOGL_ERROR, foh, "Rx OPSTART NACK for non-existent MO\n");
@@ -263,6 +269,9 @@ static void nm_rx_get_attr_rep(struct msgb *oml_msg)
struct gsm_bts *bts = sign_link->trx->bts;
struct gsm_abis_mo *mo;
+ if (!is_ipa_abisip_bts(bts))
+ return;
+
mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst);
if (mo == NULL)
LOGPFOH(DNM, LOGL_ERROR, foh, "Rx Get Attribute Report for non-existent MO\n");
@@ -276,6 +285,9 @@ static void nm_rx_set_bts_attr_ack(struct msgb *oml_msg)
struct e1inp_sign_link *sign_link = oml_msg->dst;
struct gsm_bts *bts = sign_link->trx->bts;
+ if (!is_ipa_abisip_bts(bts))
+ return;
+
if (foh->obj_class != NM_OC_BTS) {
LOG_BTS(bts, DNM, LOGL_ERROR, "Set BTS Attr Ack received on non BTS object!\n");
return;
@@ -289,8 +301,12 @@ static void nm_rx_set_radio_attr_ack(struct msgb *oml_msg)
struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
struct e1inp_sign_link *sign_link = oml_msg->dst;
struct gsm_bts *bts = sign_link->trx->bts;
- struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
+ struct gsm_bts_trx *trx;
+
+ if (!is_ipa_abisip_bts(bts))
+ return;
+ trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
if (!trx || foh->obj_class != NM_OC_RADIO_CARRIER) {
LOGPFOH(DNM, LOGL_ERROR, foh, "Set Radio Carrier Attr Ack received on non Radio Carrier object!\n");
return;
@@ -301,8 +317,14 @@ static void nm_rx_set_radio_attr_ack(struct msgb *oml_msg)
static void nm_rx_set_chan_attr_ack(struct msgb *oml_msg)
{
struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
- struct gsm_bts_trx_ts *ts = abis_nm_get_ts(oml_msg);
+ struct e1inp_sign_link *sign_link = oml_msg->dst;
+ struct gsm_bts *bts = sign_link->trx->bts;
+ struct gsm_bts_trx_ts *ts;
+
+ if (!is_ipa_abisip_bts(bts))
+ return;
+ ts = abis_nm_get_ts(oml_msg);
if (!ts || foh->obj_class != NM_OC_CHANNEL) {
LOGPFOH(DNM, LOGL_ERROR, foh, "Set Channel Attr Ack received on non Radio Channel object!\n");
return;