aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith <keith@rhizomatica.org>2020-03-26 16:33:59 -0500
committerpespin <pespin@sysmocom.de>2020-03-26 23:32:49 +0000
commit2b6acd88732e5a3273d9f3ce84a76ebe035a4fd8 (patch)
tree720609d97016319dc0d8687f194e0f5f10d243f1
parente5e2f747c35d6d02ad5f631fc99d959d1300b5fa (diff)
Don't check ul_control_block before decoding into it.
This patch corrects an error introduced in 6fd8ffb6fe62586a6880780678cbee3d9f97e763 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
-rw-r--r--src/pdch.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pdch.cpp b/src/pdch.cpp
index 1505068..519028d 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -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);