diff options
Diffstat (limited to 'lib/ssl/src/dtls_gen_connection.erl')
-rw-r--r-- | lib/ssl/src/dtls_gen_connection.erl | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/ssl/src/dtls_gen_connection.erl b/lib/ssl/src/dtls_gen_connection.erl index c075fa5879..446a065ac3 100644 --- a/lib/ssl/src/dtls_gen_connection.erl +++ b/lib/ssl/src/dtls_gen_connection.erl @@ -82,10 +82,10 @@ %%==================================================================== %% Setup %%==================================================================== -start_fsm(Role, Host, Port, Socket, {#{erl_dist := false},_, Tracker} = Opts, +start_fsm(Role, Host, Port, Socket, {_,_, Tracker} = Opts, User, {CbModule, _, _, _, _} = CbInfo, - Timeout) -> - try + Timeout) -> + try {ok, Pid} = dtls_connection_sup:start_child([Role, Host, Port, Socket, Opts, User, CbInfo]), {ok, SslSocket} = ssl_gen_statem:socket_control(?MODULE, Socket, [Pid], CbModule, Tracker), @@ -545,10 +545,9 @@ handle_info({CloseTag, Socket}, StateName, %% with widespread implementation practice. case (Active == false) andalso (CTs =/= []) of false -> - case Version of - {254, N} when N =< 253 -> + if (?DTLS_GTE(Version, ?DTLS_1_2)) -> ok; - _ -> + true -> %% As invalidate_sessions here causes performance issues, %% we will conform to the widespread implementation %% practice and go against the spec @@ -634,7 +633,7 @@ next_dtls_record(Data, StateName, #state{protocol_buffers = #protocol_buffers{ ssl_options = SslOpts} = State0) -> case dtls_record:get_dtls_records(Data, {DataTag, StateName, Version, - [dtls_record:protocol_version(Vsn) || Vsn <- ?ALL_AVAILABLE_DATAGRAM_VERSIONS]}, + [dtls_record:protocol_version_name(Vsn) || Vsn <- ?ALL_AVAILABLE_DATAGRAM_VERSIONS]}, Buf0, SslOpts) of {Records, Buf1} -> CT1 = CT0 ++ Records, |