aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-12-01 02:33:01 +0700
committerlaforge <laforge@osmocom.org>2019-12-02 08:46:10 +0000
commita1d175ab664e210d9c4dfa89c374cd581d6bb0c1 (patch)
treeeb0660005f6a0ead424e84b93dc9dc8846240383
parent5e4fdb23a48fa9990e739d39296289403ce8cbe0 (diff)
abis_nm.c: fix RSL connection timeout for trx->nr > 0
After sending of NM_MT_IPACC_RSL_CONNECT message, we start a timer, and stop it on receipt of NM_MT_IPACC_RSL_CONNECT_{ACK,NACK}. When running a multi-trx setup, one can see the following warnings: DRSL NOTICE abis_nm.c:2852 (bts=0,trx=1) RSL connection request timed out DRSL NOTICE abis_nm.c:2852 (bts=0,trx=2) RSL connection request timed out even despite NM_MT_IPACC_RSL_CONNECT is actually being acknowledged. The problem is in abis_nm_rx_ipacc(): we cannot just use sign_link->trx, because the message itself was received over the OML link, so this pointer always gives us C0/TRX0. Instead, we must find a TRX by its number from the FOH header using gsm_bts_trx_by_nr(). Change-Id: Ib4b9a198da11c88a51cfa78ffb7e7235a6365ef4
-rw-r--r--src/osmo-bsc/abis_nm.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index ca0df683d..7ca4e7983 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -2699,6 +2699,7 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
struct tlv_parsed tp;
struct ipacc_ack_signal_data signal;
struct e1inp_sign_link *sign_link = msg->dst;
+ struct gsm_bts_trx *trx;
foh = (struct abis_om_fom_hdr *) (oh->data + 1 + idstrlen);
@@ -2709,6 +2710,10 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
abis_nm_tlv_parse(&tp, sign_link->trx->bts, foh->data, oh->length-sizeof(*foh));
+ /* The message might be received over the main OML link, so we cannot
+ * just use sign_link->trx. Resolve it by number from the FOM header. */
+ trx = gsm_bts_trx_by_nr(sign_link->trx->bts, foh->obj_inst.trx_nr);
+
DEBUGPFOH(DNM, foh, "Rx IPACCESS(0x%02x): %s\n", foh->msg_type,
osmo_hexdump(foh->data, oh->length - sizeof(*foh)));
@@ -2727,7 +2732,9 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
DEBUGPC(DNM, "STREAM=0x%02x ",
*TLVP_VAL(&tp, NM_ATT_IPACC_STREAM_ID));
DEBUGPC(DNM, "\n");
- osmo_timer_del(&sign_link->trx->rsl_connect_timeout);
+ if (!trx)
+ goto obj_inst_error;
+ osmo_timer_del(&trx->rsl_connect_timeout);
break;
case NM_MT_IPACC_RSL_CONNECT_NACK:
LOGPFOH(DNM, LOGL_ERROR, foh, "RSL CONNECT NACK ");
@@ -2736,7 +2743,9 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
abis_nm_nack_cause_name(*TLVP_VAL(&tp, NM_ATT_NACK_CAUSES)));
else
LOGPC(DNM, LOGL_ERROR, "\n");
- osmo_timer_del(&sign_link->trx->rsl_connect_timeout);
+ if (!trx)
+ goto obj_inst_error;
+ osmo_timer_del(&trx->rsl_connect_timeout);
break;
case NM_MT_IPACC_SET_NVATTR_ACK:
DEBUGPFOH(DNM, foh, "SET NVATTR ACK\n");
@@ -2783,12 +2792,16 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
case NM_MT_IPACC_RSL_CONNECT_NACK:
case NM_MT_IPACC_SET_NVATTR_NACK:
case NM_MT_IPACC_GET_NVATTR_NACK:
- signal.trx = gsm_bts_trx_by_nr(sign_link->trx->bts, foh->obj_inst.trx_nr);
+ if (!trx)
+ goto obj_inst_error;
+ signal.trx = trx;
signal.msg_type = foh->msg_type;
osmo_signal_dispatch(SS_NM, S_NM_IPACC_NACK, &signal);
break;
case NM_MT_IPACC_SET_NVATTR_ACK:
- signal.trx = gsm_bts_trx_by_nr(sign_link->trx->bts, foh->obj_inst.trx_nr);
+ if (!trx)
+ goto obj_inst_error;
+ signal.trx = trx;
signal.msg_type = foh->msg_type;
osmo_signal_dispatch(SS_NM, S_NM_IPACC_ACK, &signal);
break;
@@ -2797,6 +2810,10 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
}
return 0;
+
+obj_inst_error:
+ LOGPFOH(DNM, LOGL_ERROR, foh, "Unknown object instance\n");
+ return -EINVAL;
}
/* send an ip-access manufacturer specific message */