From 594c2568d94761617e6155acec4f28ca5cb5cbe1 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 24 Sep 2011 14:33:00 +0200 Subject: sctp_handler: Terminate process in case SCTP peer becomes unreachable 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. --- src/sctp_handler.erl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3