aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-07-25 17:40:58 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2023-07-25 18:05:50 +0200
commit61f64c39a0689e131d4286990d36876b2685dfc5 (patch)
treef7be40419543f0d13b1c39b889ae87fdbc53d048
parenta1e54e7e27691653a9e527d9235a32ad10b144e9 (diff)
gprs_rlc_ul_window: Make sure V(N) array is cleared during reset_state()
Otherwise unit tests (the only real used of that API so far) would end up with v_r and v_q variables reset, but with previous state in v_n array, which is not good. Let's make sure everything is reset in gprs_rlc_ul_window::reset_state(), and simply call that method during constructor time. Change-Id: I007b672527664b05353077b9208722056799f43f
-rw-r--r--src/rlc.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/rlc.h b/src/rlc.h
index 5c6930c7..d4a7a5e1 100644
--- a/src/rlc.h
+++ b/src/rlc.h
@@ -573,10 +573,8 @@ inline const uint16_t gprs_rlc_dl_window::distance() const
}
inline gprs_rlc_ul_window::gprs_rlc_ul_window()
- : m_v_r(0)
- , m_v_q(0)
{
- m_v_n.reset();
+ reset_state();
}
inline bool gprs_rlc_ul_window::is_in_window(uint16_t bsn) const
@@ -603,6 +601,7 @@ inline void gprs_rlc_ul_window::reset_state()
{
m_v_r = 0;
m_v_q = 0;
+ m_v_n.reset();
}
inline const void gprs_rlc_ul_window::set_v_r(int v_r)