From 72e395656d19a3c7b585071f2aea403074652f2b Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 30 Jun 2020 17:57:42 +0200 Subject: [PATCH] Set correct GSMTAP channel type for PDTCH messages returning error For instance, that may happen because the len of the message is not filling the expect size (because padding is missing for example). Still, in this case we know the channel type, so we set it so that wireshark tries to decode the message as a data one. Change-Id: Ifea94095d669b528874e64ca823a776cd6e22b4b --- src/pcu_l1_if.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 23f6fbbc..7fa82fb5 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -315,6 +315,7 @@ static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind) int rc; int current_fn = get_current_fn(); pcu_l1_meas meas; + uint8_t gsmtap_chantype; LOGP(DL1IF, LOGL_DEBUG, "Data indication received: sapi=%d arfcn=%d " "fn=%d cur_fn=%d block=%d data=%s\n", data_ind->sapi, @@ -335,19 +336,22 @@ static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind) rc = pcu_rx_data_ind_pdtch(data_ind->trx_nr, data_ind->ts_nr, data_ind->data, data_ind->len, data_ind->fn, &meas); + gsmtap_chantype = GSMTAP_CHANNEL_PDTCH; break; case PCU_IF_SAPI_BCCH: rc = pcu_rx_data_ind_bcch(data_ind->data, data_ind->len); + gsmtap_chantype = GSMTAP_CHANNEL_BCCH; break; default: LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with " "unsupported sapi %d\n", data_ind->sapi); rc = -EINVAL; + gsmtap_chantype = GSMTAP_CHANNEL_UNKNOWN; } if (rc < 0 && (bts->gsmtap_categ_mask & (1 <gsmtap, data_ind->arfcn | GSMTAP_ARFCN_F_UPLINK, data_ind->ts_nr, - GSMTAP_CHANNEL_UNKNOWN, 0, data_ind->fn, meas.rssi, meas.link_qual, data_ind->data, data_ind->len); + gsmtap_chantype, 0, data_ind->fn, meas.rssi, meas.link_qual, data_ind->data, data_ind->len); } return rc;