Don't check ul_control_block before decoding into it.

This patch corrects an error introduced in
6fd8ffb6fe
That commit allowed us to send the data over GSMTAP even
if the Uplink Control Block had invalid content,
that is to say, if decode_gsm_rlcmac_uplink() returned error.

However the check for ul_control_block->u.MESSAGE_TYPE
was place before decode_gsm_rlcmac_uplink()

Change-Id: Ic47602e5c6a13571b92c0a939fc3514110b82444
This commit is contained in:
Keith Whyte 2020-03-26 16:33:59 -05:00 committed by pespin
parent e5e2f747c3
commit 2b6acd8873
1 changed files with 1 additions and 1 deletions

View File

@ -706,12 +706,12 @@ int gprs_rlcmac_pdch::rcv_control_block(const uint8_t *data, uint8_t data_len,
LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n");
rc = decode_gsm_rlcmac_uplink(rlc_block, ul_control_block);
if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK)
bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len);
else
bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len);
rc = decode_gsm_rlcmac_uplink(rlc_block, ul_control_block);
if(rc < 0) {
LOGP(DRLCMACUL, LOGL_ERROR, "Dropping Uplink Control Block with invalid "
"content, decode failed: %d)\n", rc);