aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2010-06-21 15:22:37 +0200
committerRaimo Niskanen <[email protected]>2010-07-07 11:44:40 +0200
commit2128fcef45951e159f05e5667841a7442acfa1be (patch)
tree3cf3f9be373e9c03dbc3b061a0d406b17a7fed81 /lib/kernel/test
parent5ef0b06ddbaa48499394c30d56fc81e7162abf50 (diff)
downloadotp-2128fcef45951e159f05e5667841a7442acfa1be.tar.gz
otp-2128fcef45951e159f05e5667841a7442acfa1be.tar.bz2
otp-2128fcef45951e159f05e5667841a7442acfa1be.zip
Fix inet_drv to detect passive mode UDP errors for SCTP builds
Debug and patch by Per Hedeland for R13B04 on erlang-patches: Connected UDP (and handling of any other errors in UDP recv()) is broken in passive mode for all SCTP-enabled builds.
Diffstat (limited to 'lib/kernel/test')
-rw-r--r--lib/kernel/test/gen_udp_SUITE.erl21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl
index bd5685952e..fa1991872b 100644
--- a/lib/kernel/test/gen_udp_SUITE.erl
+++ b/lib/kernel/test/gen_udp_SUITE.erl
@@ -34,12 +34,12 @@
-export([send_to_closed/1,
buffer_size/1, binary_passive_recv/1, bad_address/1,
- read_packets/1, open_fd/1]).
+ read_packets/1, open_fd/1, connect/1]).
all(suite) ->
[send_to_closed,
buffer_size, binary_passive_recv, bad_address, read_packets,
- open_fd].
+ open_fd, connect].
init_per_testcase(_Case, Config) ->
?line Dog=test_server:timetrap(?default_timeout),
@@ -408,3 +408,20 @@ start_node(Name) ->
stop_node(Node) ->
?t:stop_node(Node).
+
+
+connect(suite) ->
+ [];
+connect(doc) ->
+ ["Test that connect/3 has effect"];
+connect(Config) when is_list(Config) ->
+ Addr = {127,0,0,1},
+ {ok,S1} = gen_udp:open(0),
+ {ok,P1} = inet:port(S1),
+ {ok,S2} = gen_udp:open(0),
+ ok = inet:setopts(S2, [{active,false}]),
+ ok = gen_udp:close(S1),
+ ok = gen_udp:connect(S2, Addr, P1),
+ ok = gen_udp:send(S2, <<16#deadbeef:32>>),
+ {error,econnrefused} = gen_udp:recv(S2, 0, 5),
+ ok.