fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/39124?usp=email )
Change subject: erab_fsm: session_modify(): split PFCP PDU handling ......................................................................
erab_fsm: session_modify(): split PFCP PDU handling
This patch prepares for a follow-up change adding the MME-initiated E-RAB modification logic. Handle the successful modification scenario in a separate function, which will be extended further soon.
Change-Id: I04fec627300fa9240e6b2bf22ff9ae08dd4c0f0d --- M src/erab_fsm.erl 1 file changed, 14 insertions(+), 15 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified
diff --git a/src/erab_fsm.erl b/src/erab_fsm.erl index a479cea..b249cd4 100644 --- a/src/erab_fsm.erl +++ b/src/erab_fsm.erl @@ -277,24 +277,23 @@ {shutdown, timeout}, {reply, From, {error, {timeout, ?FUNCTION_NAME}}}};
-session_modify(info, #pfcp{} = PDU, +session_modify(info, #pfcp{type = session_modification_response, + seid = SEID_Rsp, %% matches F-SEID we sent in the ESTABLISH Req + ie = #{pfcp_cause := 'Request accepted'}}, #erab_state{from = From, seid_loc = SEID_Rsp, c2u = C2U} = S) -> - case PDU of - #pfcp{type = session_modification_response, - seid = SEID_Rsp, %% matches F-SEID we sent in the ESTABLISH Req - ie = #{pfcp_cause := 'Request accepted'}} -> - ?LOG_DEBUG("PFCP session modified"), - {next_state, erab_setup, - S#erab_state{from = undefined}, - [{reply, From, {ok, C2U}}]}; - _ -> - ?LOG_ERROR("Rx unexpected PFCP PDU: ~p", [PDU]), - {stop_and_reply, - {shutdown, unexp_pdu}, - {reply, From, {error, {unexp_pdu, ?FUNCTION_NAME}}}} - end; + ?LOG_DEBUG("PFCP session modified"), + {next_state, erab_setup, + S#erab_state{from = undefined}, + [{reply, From, {ok, C2U}}]}; + +session_modify(info, #pfcp{} = PDU, + #erab_state{from = From}) -> + ?LOG_ERROR("Rx unexpected PFCP PDU: ~p", [PDU]), + {stop_and_reply, + {shutdown, unexp_pdu}, + {reply, From, {error, {unexp_pdu, ?FUNCTION_NAME}}}};
session_modify(Event, EventData, S) -> handle_event(?FUNCTION_NAME, Event, EventData, S).