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.
This commit is contained in:
Harald Welte 2011-09-24 14:33:00 +02:00
parent 61d9a9eae0
commit 594c2568d9
1 changed files with 12 additions and 1 deletions

View File

@ -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