aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf_dl.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2016-01-14 15:52:28 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-02 17:06:33 +0100
commitfd2e08738bccdd95f970d560de8f32e4e2b4182e (patch)
treebbb9e2f2a3125c6eb3d0764cb893bd423e3c7a84 /src/tbf_dl.cpp
parentf62c19bf481c095e275b1dd74e288a868821d12e (diff)
WIP: Handle num_blocks == 0 in gprs_rlcmac_dl_tbf::update_window
Don't let the TBF die in that case. TODO: Check whether the FIXME still applies Ticket: OW#???? Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf_dl.cpp')
-rw-r--r--src/tbf_dl.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 62580226..e6f5889a 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -739,19 +739,21 @@ int gprs_rlcmac_dl_tbf::update_window(unsigned first_bsn,
"(BSN=%d) R=ACK I=NACK\n", first_bsn,
show_rbb, m_window.mod_sns(behind_last_bsn - 1));
- /* apply received array to receive state (SSN-64..SSN-1) */
- /* calculate distance of ssn from V(S) */
- dist = m_window.mod_sns(m_window.v_s() - behind_last_bsn);
- /* check if distance is less than distance V(A)..V(S) */
- if (dist >= m_window.distance()) {
- /* this might happpen, if the downlink assignment
- * was not received by ms and the ack refers
- * to previous TBF
- * FIXME: we should implement polling for
- * control ack!*/
- LOGP(DRLCMACDL, LOGL_NOTICE, "- ack range is out of "
- "V(A)..V(S) range %s Free TBF!\n", tbf_name(this));
- return 1; /* indicate to free TBF */
+ /* apply received array to receive state (first_bsn..behind_last_bsn-1) */
+ if (num_blocks > 0) {
+ /* calculate distance of ssn from V(S) */
+ dist = m_window.mod_sns(m_window.v_s() - behind_last_bsn);
+ /* check if distance is less than distance V(A)..V(S) */
+ if (dist >= m_window.distance()) {
+ /* this might happpen, if the downlink assignment
+ * was not received by ms and the ack refers
+ * to previous TBF
+ * FIXME: we should implement polling for
+ * control ack!*/
+ LOGP(DRLCMACDL, LOGL_NOTICE, "- ack range is out of "
+ "V(A)..V(S) range %s Free TBF!\n", tbf_name(this));
+ return 1; /* indicate to free TBF */
+ }
}
error_rate = analyse_errors(show_rbb, behind_last_bsn, &ana_res);