From 201dbe04f7c3834418b2565f8b3e7b5ab48e6ba7 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 11 Oct 2021 19:04:24 +0200 Subject: [PATCH] pdch: PktResReq: Avoid releasing ULC entry if expecting something else on UL Let's only release PDCH ULC entry if it was indeed what we expected. In other case, time it out. Move the case in the switch statement to the start to easy function readibility (early return style). Change-Id: I3d8749acca8e7859295d73cce556b2083169f726 --- src/pdch.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pdch.cpp b/src/pdch.cpp index 807ce459..a503a555 100644 --- a/src/pdch.cpp +++ b/src/pdch.cpp @@ -638,6 +638,14 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, } switch (item->type) { + case PDCH_ULC_NODE_TBF_USF: + /* Is it actually valid for an MS to send a PKT Res Req during USF? */ + ul_tbf = item->tbf_usf.ul_tbf; + LOGPDCH(this, DRLCMAC, LOGL_NOTICE, "FN=%u PKT RESOURCE REQ: " + "Unexpectedly received, waiting USF of %s\n", + fn, tbf_name(item->tbf_usf.ul_tbf)); + /* Ignore it, let common path expire related ULC entry */ + goto return_unref; case PDCH_ULC_NODE_SBA: sba = item->sba.sba; LOGPDCH(this, DRLCMAC, LOGL_DEBUG, "FN=%u PKT RESOURCE REQ: " @@ -675,14 +683,6 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, ul_tbf->n_reset(N3103); pdch_ulc_release_node(ulc, item); break; - case PDCH_ULC_NODE_TBF_USF: - /* Is it actually valid for an MS to send a PKT Res Req during USF? */ - ul_tbf = item->tbf_usf.ul_tbf; - LOGPDCH(this, DRLCMAC, LOGL_NOTICE, "FN=%u PKT RESOURCE REQ: " - "Unexpectedly received, waiting USF of %s\n", - fn, tbf_name(item->tbf_usf.ul_tbf)); - pdch_ulc_release_node(ulc, item); - break; default: OSMO_ASSERT(0); }