Change in osmo-bsc[master]: abis_nm.c: fix RSL connection timeout for trx->nr > 0

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Dec 2 08:46:10 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/16350 )

Change subject: abis_nm.c: fix RSL connection timeout for trx->nr > 0
......................................................................

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
---
M src/osmo-bsc/abis_nm.c
1 file changed, 21 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index ca0df68..7ca4e79 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -2699,6 +2699,7 @@
 	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 @@
 
 	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 @@
 			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 @@
 				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 @@
 	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 @@
 	}
 
 	return 0;
+
+obj_inst_error:
+	LOGPFOH(DNM, LOGL_ERROR, foh, "Unknown object instance\n");
+	return -EINVAL;
 }
 
 /* send an ip-access manufacturer specific message */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/16350
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4b9a198da11c88a51cfa78ffb7e7235a6365ef4
Gerrit-Change-Number: 16350
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191202/faaa0e99/attachment.htm>


More information about the gerrit-log mailing list