From 6d520405dfc2634717db12332c2fb415c2f9982d Mon Sep 17 00:00:00 2001 From: Aravind Sirsikar Date: Tue, 30 Aug 2016 23:14:09 +0530 Subject: Fix EPDAN with BSNs out of receiver window --- src/rlc.cpp | 2 +- src/tbf_dl.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/rlc.cpp b/src/rlc.cpp index 88a4cb2..75eefe1 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -106,7 +106,7 @@ 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 num_blocks = rbb->cur_bit > distance() ? distance() : rbb->cur_bit; unsigned bsn; /* first_bsn is in range V(A)..V(S) */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 2284f11..8687a71 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -844,7 +844,8 @@ int gprs_rlcmac_dl_tbf::analyse_errors(char *show_rbb, uint8_t ssn, uint16_t bsn = 0; unsigned received_bytes = 0, lost_bytes = 0; unsigned received_packets = 0, lost_packets = 0; - unsigned num_blocks = strlen(show_rbb); + unsigned num_blocks = strlen(show_rbb) > m_window.distance() ? + m_window.distance() : strlen(show_rbb); /* SSN - 1 is in range V(A)..V(S)-1 */ for (unsigned int bitpos = 0; bitpos < num_blocks; bitpos++) { @@ -924,7 +925,8 @@ int gprs_rlcmac_dl_tbf::update_window(unsigned first_bsn, char show_rbb[RLC_MAX_SNS + 1]; int error_rate; struct ana_result ana_res; - unsigned num_blocks = rbb->cur_bit; + unsigned num_blocks = rbb->cur_bit > m_window.distance() + ? m_window.distance(): rbb->cur_bit; unsigned behind_last_bsn = m_window.mod_sns(first_bsn + num_blocks); Decoding::extract_rbb(rbb, show_rbb); @@ -954,7 +956,6 @@ int gprs_rlcmac_dl_tbf::update_window(unsigned first_bsn, "V(A) = %d ..V(S) = %d range %s Free TBF! num_blocks = %d dist = %d behind_last_bsn = %d first_bsn = %d log_ptr(%d)\n",m_window.v_a(), m_window.v_s(), tbf_name(this), num_blocks, dist, behind_last_bsn, first_bsn, log_ptrx); error_hit = true; - return 1; /* indicate to free TBF */ } } -- cgit v1.2.3