fixeria has uploaded this change for review. ( 
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(-)



  git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw 
refs/changes/24/39124/1

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).

--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/39124?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I04fec627300fa9240e6b2bf22ff9ae08dd4c0f0d
Gerrit-Change-Number: 39124
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>

Reply via email to