osmith has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-s1gw/+/37040?usp=email )

Change subject: sctp_server: allow passing bind address as string
......................................................................

sctp_server: allow passing bind address as string

Change-Id: I1557e4dd8c918ed70e93ff23dcf0e77c9c9e34a3
---
M src/sctp_server.erl
1 file changed, 14 insertions(+), 1 deletion(-)

Approvals:
  osmith: Looks good to me, approved; Verified




diff --git a/src/sctp_server.erl b/src/sctp_server.erl
index 883991a..f032492 100644
--- a/src/sctp_server.erl
+++ b/src/sctp_server.erl
@@ -25,7 +25,7 @@
 %% ------------------------------------------------------------------

 start_link() ->
-    start_link({127,0,0,1}, ?S1AP_PORT).
+    start_link("127.0.0.1", ?S1AP_PORT).

 start_link(BindAddr, BindPort) ->
     gen_server:start_link({local, ?MODULE}, ?MODULE,
@@ -40,6 +40,10 @@
 %% gen_server API
 %% ------------------------------------------------------------------

+init([BindAddrStr, BindPort]) when is_list(BindAddrStr) ->
+    {ok, BindAddr} = inet:parse_address(BindAddrStr),
+    init([BindAddr, BindPort]);
+
 init([BindAddr, BindPort]) ->
     process_flag(trap_exit, true),
     {ok, Sock} = gen_sctp:open([{ip, BindAddr},

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

Gerrit-Project: osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I1557e4dd8c918ed70e93ff23dcf0e77c9c9e34a3
Gerrit-Change-Number: 37040
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osm...@sysmocom.de>
Gerrit-Reviewer: osmith <osm...@sysmocom.de>
Gerrit-CC: fixeria <vyanits...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to