From a68cdf57a31920969729f801507ba1e39d05be86 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Thu, 5 Jan 2023 15:43:36 +0100 Subject: pcu_sock: check trx mo state Make sure that the TRX MO state is enabled and unlocked before filling in any TRX information into the info indication Change-Id: I7a93826e6b0df187425310cb82854e7d7fb47e72 Related: OS#5198 --- src/osmo-bsc/pcu_sock.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index ddcf66b54..289382126 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -113,6 +114,14 @@ static void info_ind_fill_trx(struct gsm_pcu_if_info_trx *trx_info, const struct trx_info->pdch_mask = 0; trx_info->arfcn = trx->arfcn; + if (trx->mo.nm_state.operational != NM_OPSTATE_ENABLED || + trx->mo.nm_state.administrative != NM_STATE_UNLOCKED) { + LOG_TRX(trx, DPCU, LOGL_INFO, "unavailable for PCU (op=%s adm=%s)\n", + abis_nm_opstate_name(trx->mo.nm_state.operational), + abis_nm_admin_name(trx->mo.nm_state.administrative)); + return; + } + for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) { ts = &trx->ts[tn]; if (ts->mo.nm_state.operational != NM_OPSTATE_ENABLED || -- cgit v1.2.3