fixeria submitted this change.

View Change

Approvals: osmith: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified
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(-)

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},

To view, visit change 42497. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I7933fceb0edcdfdc95ace35416297b11c83f0bc9
Gerrit-Change-Number: 42497
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>