fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42497?usp=email )
Change subject: s1ap_proxy: fix build_erab_setup_response_failure() to report all E-RABs ......................................................................
s1ap_proxy: fix build_erab_setup_response_failure() to report all E-RABs
The previous implementation only included the first E-RAB from the registry in the failure response (a FIXME was left in place).
Fix it to extract all E-RAB IDs from the original E-RAB SETUP REQUEST and include each of them in the failure list, as required by 3GPP.
Change-Id: I7933fceb0edcdfdc95ace35416297b11c83f0bc9 Related: osmo-ttcn3-hacks.git I8a5dc338d28013dc85e1ce4b3bdac92cb3b35304 --- M src/s1ap_proxy.erl 1 file changed, 15 insertions(+), 9 deletions(-)
Approvals: osmith: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified
diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl index dcd053e..8f1c107 100644 --- a/src/s1ap_proxy.erl +++ b/src/s1ap_proxy.erl @@ -329,7 +329,16 @@ {{error, Reason}, S1} -> ?LOG_NOTICE("Failed to process E-RAB SETUP REQUEST: ~p", [Reason]), ctr_inc(?S1GW_CTR_S1AP_PROXY_IN_PKT_PROC_ERROR, S1), - PDU = build_erab_setup_response_failure(S1), + ERABIds = [ERABId || + %% get inner IEs of the E-RABToBeSetupListBearerSUReq + #'ProtocolIE-Field'{id = ?'id-E-RABToBeSetupListBearerSUReq', + value = Items} + <- C0#'E-RABSetupRequest'.protocolIEs, + %% for each inner IE, extract the E-RAB-ID + #'ProtocolIE-Field'{id = ?'id-E-RABToBeSetupItemBearerSUReq', + value = #'E-RABToBeSetupItemBearerSUReq'{'e-RAB-ID' = ERABId}} + <- Items], + PDU = build_erab_setup_response_failure(ERABIds, S1), ctr_inc(?S1GW_CTR_S1AP_PROXY_OUT_PKT_REPLY_ERAB_SETUP_RSP, S1), {{reply, PDU}, S1} %% reply PDU back to sender end; @@ -1102,18 +1111,15 @@ {{ok, IEs}, S}.
-build_erab_setup_response_failure(#proxy_state{erabs = ERABs, - mme_ue_id = MmeUeId, +build_erab_setup_response_failure(ERABIds, + #proxy_state{mme_ue_id = MmeUeId, enb_ue_id = EnbUeId}) -> - %% FIXME: Currently we respond with E-RAB-ID of the first E-RAB in the registry. - %% Instead, we need to iterate over E-RABs in the REQUEST and reject them all. - [{_, FirstERABid}|_] = dict:fetch_keys(ERABs), Cause = {transport, 'transport-resource-unavailable'}, - ERABitem = #'E-RABItem'{'e-RAB-ID' = FirstERABid, - cause = Cause}, ERABlist = [#'ProtocolIE-Field'{id = ?'id-E-RABItem', criticality = ignore, - value = ERABitem}], + value = #'E-RABItem'{'e-RAB-ID' = ERABId, + cause = Cause}} + || ERABId <- ERABIds], IEs = [#'ProtocolIE-Field'{id = ?'id-MME-UE-S1AP-ID', criticality = ignore, value = MmeUeId},