From 40d19e2d32df59edd6bebdc306be4e0813b88bb1 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 25 Jul 2018 15:08:35 +0200 Subject: [PATCH] fix PDCP reset --- lib/src/upper/pdcp.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/src/upper/pdcp.cc b/lib/src/upper/pdcp.cc index 24dbd27d3..acf0d6988 100644 --- a/lib/src/upper/pdcp.cc +++ b/lib/src/upper/pdcp.cc @@ -91,14 +91,16 @@ void pdcp::reestablish() { void pdcp::reset() { - pthread_rwlock_rdlock(&rwlock); + // destroy all bearers + pthread_rwlock_wrlock(&rwlock); for (pdcp_map_t::iterator it = pdcp_array.begin(); it != pdcp_array.end(); ++it) { - it->second->reset(); - } - if (valid_lcid(0)) { - pdcp_array.at(0)->init(rlc, rrc, gw, pdcp_log, default_lcid, default_cnfg); + delete(it->second); + pdcp_array.erase(it); } pthread_rwlock_unlock(&rwlock); + + // add default SRB0 again + add_bearer(0, default_cnfg); } /*******************************************************************************