laforge submitted this change.

View Change

Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified
s1ap_proxy: Handle "E-RABs Failed to Setup List" IE

The HANDOVER REQUEST ACKNOWLEDGE PDU may contain an optional IE with
the list of E-RABs that the eNB failed to setup. The S1GW needs to
handle this list and terminate the respective E-RAB FSMs.

Change-Id: I207094fd0019d10a61a5566c649ded1f98a41967
Related: 05b55609 ("s1ap_proxy: Add support for S1 HANDOVER procedure")
Related: SYS#7309
---
M src/s1ap_proxy.erl
1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl
index 658f08c..22c2da7 100644
--- a/src/s1ap_proxy.erl
+++ b/src/s1ap_proxy.erl
@@ -690,8 +690,9 @@
value = C0} = Msg}, S0) ->
?LOG_DEBUG("Processing HANDOVER REQUEST ACKNOWLEDGE"),
ctr_inc(?S1GW_CTR_S1AP_PROXY_IN_PKT_HANDOVER_REQ_ACK, S0),
- case handle_ies(?'id-E-RABAdmittedList',
- C0#'HandoverRequestAcknowledge'.protocolIEs, S0) of
+ %% handle the list of admitted E-RABs
+ {Result, S2} = case handle_ies(?'id-E-RABAdmittedList',
+ C0#'HandoverRequestAcknowledge'.protocolIEs, S0) of
{{ok, IEs}, S1} ->
C1 = C0#'HandoverRequestAcknowledge'{protocolIEs = IEs},
PDU = {Outcome, Msg#'SuccessfulOutcome'{value = C1}},
@@ -700,7 +701,13 @@
?LOG_NOTICE("Failed to process HANDOVER REQUEST ACKNOWLEDGE: ~p", [Reason]),
ctr_inc(?S1GW_CTR_S1AP_PROXY_IN_PKT_PROC_ERROR, S1),
{drop, S1} %% drop this PDU
- end;
+ end,
+ %% handle the (optional) list of failed E-RABs
+ %% no #proxy_state modification is expected here
+ handle_ies(?'id-E-RABFailedToSetupListHOReqAck',
+ C0#'HandoverRequestAcknowledge'.protocolIEs, S2),
+ {Result, S2};
+

%% TODO: 9.1.5.8 PATH SWITCH REQUEST :: (M) Transport Layer Address
%% TODO: 9.1.5.9 PATH SWITCH REQUEST ACKNOWLEDGE :: (M) Transport Layer Address
@@ -1149,6 +1156,22 @@
{{error, erab_not_registered}, S}
end;

+handle_ie([?'id-E-RABFailedToSetupListHOReqAck'], C, S) ->
+ %% This IE contains a list of id-E-RABFailedtoSetupItemHOReqAck, so patch inner IEs
+ handle_ies(?'id-E-RABFailedtoSetupItemHOReqAck', C, S);
+
+handle_ie([?'id-E-RABFailedtoSetupItemHOReqAck',
+ ?'id-E-RABFailedToSetupListHOReqAck'],
+ #'E-RABFailedToSetupItemHOReqAck'{'e-RAB-ID' = ERABId} = C, S) ->
+ %% poke E-RAB FSM
+ case erab_fsm_find(ERABId, S) of
+ {ok, Pid} ->
+ ok = erab_fsm:erab_release_ind(Pid),
+ {{ok, C}, S};
+ error ->
+ ?LOG_ERROR("E-RAB-ID ~p is not registered", [erab_uid(ERABId, S)]),
+ {{error, erab_not_registered}, S}
+ end;

%% Catch-all variant, which should not be called normally
handle_ie(P, C, S) ->

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

Gerrit-MessageType: merged
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I207094fd0019d10a61a5566c649ded1f98a41967
Gerrit-Change-Number: 41089
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-CC: jolly <andreas@eversberg.eu>