diff options
Diffstat (limited to 'lib/kernel/src/inet.erl')
-rw-r--r-- | lib/kernel/src/inet.erl | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl index 1a03424f88..92c1802a86 100644 --- a/lib/kernel/src/inet.erl +++ b/lib/kernel/src/inet.erl @@ -531,11 +531,11 @@ getservbyname(Name, Protocol) when is_atom(Name) -> options() -> [ tos, priority, reuseaddr, keepalive, dontroute, linger, - broadcast, sndbuf, recbuf, nodelay, + broadcast, sndbuf, recbuf, nodelay, ipv6_v6only, buffer, header, active, packet, deliver, mode, multicast_if, multicast_ttl, multicast_loop, exit_on_close, high_watermark, low_watermark, - bit8, send_timeout, send_timeout_close + send_timeout, send_timeout_close ]. %% Return a list of statistics options @@ -552,7 +552,7 @@ stats() -> connect_options() -> [tos, priority, reuseaddr, keepalive, linger, sndbuf, recbuf, nodelay, header, active, packet, packet_size, buffer, mode, deliver, - exit_on_close, high_watermark, low_watermark, bit8, send_timeout, + exit_on_close, high_watermark, low_watermark, send_timeout, send_timeout_close, delay_send,raw]. connect_options(Opts, Family) -> @@ -607,8 +607,8 @@ con_add(Name, Val, R, Opts, AllOpts) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% listen_options() -> [tos, priority, reuseaddr, keepalive, linger, sndbuf, recbuf, nodelay, - header, active, packet, buffer, mode, deliver, backlog, - exit_on_close, high_watermark, low_watermark, bit8, send_timeout, + header, active, packet, buffer, mode, deliver, backlog, ipv6_v6only, + exit_on_close, high_watermark, low_watermark, send_timeout, send_timeout_close, delay_send, packet_size,raw]. listen_options(Opts, Family) -> @@ -664,7 +664,7 @@ list_add(Name, Val, R, Opts, As) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% udp_options() -> [tos, priority, reuseaddr, sndbuf, recbuf, header, active, buffer, mode, - deliver, + deliver, ipv6_v6only, broadcast, dontroute, multicast_if, multicast_ttl, multicast_loop, add_membership, drop_membership, read_packets,raw]. @@ -720,7 +720,7 @@ udp_add(Name, Val, R, Opts, As) -> sctp_options() -> [ % The following are generic inet options supported for SCTP sockets: mode, active, buffer, tos, priority, dontroute, reuseaddr, linger, sndbuf, - recbuf, + recbuf, ipv6_v6only, % Other options are SCTP-specific (though they may be similar to their % TCP and UDP counter-parts): @@ -1283,7 +1283,10 @@ tcp_controlling_process(S, NewOwner) when is_port(S), is_pid(NewOwner) -> _ -> case prim_inet:getopt(S, active) of {ok, A0} -> - prim_inet:setopt(S, active, false), + case A0 of + false -> ok; + _ -> prim_inet:setopt(S, active, false) + end, case tcp_sync_input(S, NewOwner, false) of true -> %% socket already closed, ok; @@ -1291,7 +1294,10 @@ tcp_controlling_process(S, NewOwner) when is_port(S), is_pid(NewOwner) -> try erlang:port_connect(S, NewOwner) of true -> unlink(S), %% unlink from port - prim_inet:setopt(S, active, A0), + case A0 of + false -> ok; + _ -> prim_inet:setopt(S, active, A0) + end, ok catch error:Reason -> |