From 19bc65012be3ea433d03327217dfe2bd1e7d442b Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 20 Jun 2019 12:19:46 +0200 Subject: [PATCH] nas: remove EPS bearer before adding updating params --- srsue/src/stack/upper/nas.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/srsue/src/stack/upper/nas.cc b/srsue/src/stack/upper/nas.cc index d44fa5c56..0ea5309f9 100644 --- a/srsue/src/stack/upper/nas.cc +++ b/srsue/src/stack/upper/nas.cc @@ -1150,9 +1150,20 @@ void nas::parse_activate_dedicated_eps_bearer_context_request(uint32_t lcid, uni // check the a linked default bearer exists if (eps_bearer.find(request.linked_eps_bearer_id) == eps_bearer.end()) { nas_log->error("No linked default EPS bearer found (%d).\n", request.linked_eps_bearer_id); + // FIXME: send reject according to 24.301 Sec 6.4.2.5 paragraph c return; } + // check if the dedicated EPS bearer already exists + if (eps_bearer.find(request.eps_bearer_id) != eps_bearer.end()) { + // according to 24.301 Sec 6.4.2.5 paragraph b) the existing bearer shall be deactived before proceeding + nas_log->error("EPS bearer already exists (%d). Removing it.\n", request.eps_bearer_id); + + // remove bearer + eps_bearer_map_t::iterator it = eps_bearer.find(request.eps_bearer_id); + eps_bearer.erase(it); + } + // create new bearer eps_bearer_t bearer = {}; bearer.type = DEDICATED_EPS_BEARER;