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 pespin: Looks good to me, but someone else must approve
sctp_proxy: fix no-op 'connecting' state timeout

We need to perform a loop state transition if we want the timer
to be scheduled for 'connecting'. Otherwise the timeout is no-op.

Change-Id: I45d874f3f73d5b9a8aa62c8a36e94e51497d6754
---
M src/sctp_proxy.erl
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/sctp_proxy.erl b/src/sctp_proxy.erl
index a40371d..82c697c 100644
--- a/src/sctp_proxy.erl
+++ b/src/sctp_proxy.erl
@@ -87,7 +87,7 @@
?LOG_INFO("State change: ~p -> ~p", [OldState, ?FUNCTION_NAME]),
%% Initiate connection establishment with the MME
{ok, Sock} = sctp_client:connect(MmeAddr, MmePort),
- {keep_state, S#{sock => Sock},
+ {next_state, connecting, S#{sock => Sock},
[{state_timeout, 2_000_000, conn_est_timeout}]};

%% Handle connection establishment timeout

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

Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I45d874f3f73d5b9a8aa62c8a36e94e51497d6754
Gerrit-Change-Number: 37265
Gerrit-PatchSet: 1
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>
Gerrit-MessageType: merged