aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-09-24 14:33:00 +0200
committerHarald Welte <laforge@gnumonks.org>2011-09-24 14:33:00 +0200
commit594c2568d94761617e6155acec4f28ca5cb5cbe1 (patch)
treee748a0f298b5596054b4e21b5b5bd1a5c82684e0
parent61d9a9eae06eec2a32db925c791936e983b39197 (diff)
sctp_handler: Terminate process in case SCTP peer becomes unreachablebow_v2
This occurred in case of an IP network outage or MSC outage. We need to properly restart the mgw_nat_usr process in order to recover.
-rw-r--r--src/sctp_handler.erl13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/sctp_handler.erl b/src/sctp_handler.erl
index 657d015..09d6b41 100644
--- a/src/sctp_handler.erl
+++ b/src/sctp_handler.erl
@@ -118,7 +118,18 @@ handle_sctp(L = #loop_data{msc_sock=MscSock, msc_remote_ip=MscRemoteIp, msc_remo
% maybe we should simply die?
NewL = L,
io:format("SCTP remote ~p shutdown~n", [RemoteIp]),
- exit(ctp_remote_shutdown);
+ exit(sctp_remote_shutdown);
+ {sctp, _Sock, RemoteIp, _RemotePort, {_Anc, Data}}
+ when is_record(Data, sctp_paddr_change) ->
+ case Data#sctp_paddr_change.state of
+ addr_unreachable ->
+ io:format("SCTP remote ~p unreachable~n",
+ [RemoteIp]),
+ exit(sctp_addr_unreachable);
+ _ ->
+ ok
+ end,
+ NewL = L;
Other ->
io:format("OTHER ~p~n", [Other]),
NewL = L