aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rlc.cpp')
-rw-r--r--src/rlc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rlc.cpp b/src/rlc.cpp
index ee2635aa..2bffccb8 100644
--- a/src/rlc.cpp
+++ b/src/rlc.cpp
@@ -105,7 +105,9 @@ void gprs_rlc_dl_window::update(BTS *bts, const struct bitvec *rbb,
uint16_t first_bsn, uint16_t *lost,
uint16_t *received)
{
- unsigned num_blocks = rbb->cur_bit;
+ unsigned dist = distance();
+ unsigned num_blocks = rbb->cur_bit > dist
+ ? dist : rbb->cur_bit;
unsigned bsn;
/* first_bsn is in range V(A)..V(S) */