Change in osmo-bsc[master]: abis_nm.c: fix RSL connection temeout 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/.

fixeria gerrit-no-reply at lists.osmocom.org
Sat Nov 30 19:50:16 UTC 2019


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/16350 )


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

abis_nm.c: fix RSL connection temeout 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, 18 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/16350/1

diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index ca0df68..81f09ce 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -2699,8 +2699,10 @@
 	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);
+	trx = gsm_bts_trx_by_nr(sign_link->trx->bts, foh->obj_inst.trx_nr);
 
 	if (strncmp((char *)&oh->data[1], abis_nm_ipa_magic, idstrlen)) {
 		LOGPFOH(DNM, LOGL_ERROR, foh, "id string is not com.ipaccess !?!\n");
@@ -2727,7 +2729,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 == NULL)
+			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 +2740,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 == NULL)
+			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 +2789,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 == NULL)
+			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 == NULL)
+			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 +2807,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: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191130/132fd98a/attachment.htm>


More information about the gerrit-log mailing list