diff options
author | Pau Espin Pedrol <pespin@espeweb.net> | 2021-03-02 13:19:39 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@espeweb.net> | 2021-03-02 18:24:46 +0100 |
commit | 8afc6bad806ac6255a04f0aae8d01a9249a05b1f (patch) | |
tree | 1f5ff95b177c89386f2059610eb6a14ff3e1a15d /src | |
parent | 5b9d0bb8e5d75e705a6829055d2b6d142a3a200c (diff) |
tbf_dl: Fix m_last_dl_drained_fn not set under some conditions
Old commit getting rid of LLC UI dummy and updating create_new_bsn()
function introduced a bug by not moving update of value m_last_dl_drained_fn
prior to a new break introduced.
As a result, the value is not updated in the case LLC queue becomes
drained but last few bytes are drained at exactly that moment.
Furthermore, then the IDLE tbf timer (X2031, keep_open())) returns always
true since according to it the drain never happened.
The impact of the bug is basically delaying a bit more than expected the
time the TBF stays in IDLE state with the TBF release process yet
to be started.
Related: OS#4849
Fixes: 7d0f9a0ec383fcfca934731bd6979b6be6629c90
Change-Id: I7420aeffda3500bcdc990291e4a56511af433ff9
Diffstat (limited to 'src')
-rw-r--r-- | src/tbf_dl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 28963788..d963644b 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -684,6 +684,10 @@ int gprs_rlcmac_dl_tbf::create_new_bsn(const uint32_t fn, enum CodingScheme cs) int payload_written = 0; if (llc_frame_length(&m_llc) == 0) { + /* The data just drained, store the current fn */ + if (m_last_dl_drained_fn < 0) + m_last_dl_drained_fn = fn; + /* It is not clear, when the next real data will * arrive, so request a DL ack/nack now */ request_dl_ack(); @@ -715,10 +719,6 @@ int gprs_rlcmac_dl_tbf::create_new_bsn(const uint32_t fn, enum CodingScheme cs) * space-1 octets */ m_llc.put_dummy_frame(space - 1); - /* The data just drained, store the current fn */ - if (m_last_dl_drained_fn < 0) - m_last_dl_drained_fn = fn; - LOGPTBFDL(this, LOGL_DEBUG, "Empty chunk, added LLC dummy command of size %d, drained_since=%d\n", llc_frame_length(&m_llc), frames_since_last_drain(fn)); |