pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-pcu/+/33922 )
Change subject: gprs_rlc_ul_window: Make sure V(N) array is cleared during reset_state()
......................................................................
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
---
M src/rlc.h
1 file changed, 19 insertions(+), 3 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/src/rlc.h b/src/rlc.h
index 5c6930c..d4a7a5e 100644
--- a/src/rlc.h
+++ b/src/rlc.h
@@ -573,10 +573,8 @@
}
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 @@
{
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)
--
To view, visit
https://gerrit.osmocom.org/c/osmo-pcu/+/33922
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I007b672527664b05353077b9208722056799f43f
Gerrit-Change-Number: 33922
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged