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
This commit is contained in:
Pau Espin 2021-05-11 14:54:40 +02:00
parent 58916318ef
commit 9b63cd04e4
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}