diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-05-11 14:54:40 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-05-12 14:24:02 +0200 |
commit | 9b63cd04e48e2b75d2b747cc042b763e12961f11 (patch) | |
tree | 6017b8fa741326186f5c09a6075c9ecda22312c4 | |
parent | 58916318eff7ca6f480201f24b8e6668740248af (diff) |
ul_tbf: Fix accessing zeroed block when checking if transfer is complete
The logic checking whether the UL TBF had already been sent all the data
(and hence was marked as finished and requesting UL ACK to be sent) was
not taking into account the case where there was still no valid block
stored, ie. when the first received UL data block was discarded for some
reason (ex: because TLLI was not set during content resolution).
Related: OS#1940
Change-Id: I739e67ae1bb40555a362170f26fb98ac69caabb2
-rw-r--r-- | src/tbf_ul.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index e92a920f..231ed063 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -528,7 +528,8 @@ int gprs_rlcmac_ul_tbf::rcv_data_block_acknowledged( /* Check if we already received all data TBF had to send: */ if (this->state_is(GPRS_RLCMAC_FLOW) /* still in flow state */ - && this->m_window.v_q() == this->m_window.v_r()) { /* if complete */ + && this->m_window.v_q() == this->m_window.v_r() /* if complete */ + && block->len) { /* if there was ever a last block received */ LOGPTBFUL(this, LOGL_DEBUG, "No gaps in received block, last block: BSN=%d CV=%d\n", rdbi->bsn, rdbi->cv); @@ -542,7 +543,7 @@ int gprs_rlcmac_ul_tbf::rcv_data_block_acknowledged( /* If TLLI is included or if we received half of the window, we send * an ack/nack */ - maybe_schedule_uplink_acknack(rlc, rdbi->cv == 0); + maybe_schedule_uplink_acknack(rlc, block->len && rdbi->cv == 0); return 0; } |