aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2010-07-02 11:55:05 +0200
committerRaimo Niskanen <[email protected]>2010-08-31 14:02:19 +0200
commitc61fe198825316de24e7b37620b3ebd8ebd81c6d (patch)
treecc4b1b016c2b26a4620cf5ed2a94515919084dca /lib
parent82d430853eb1f53e6022de647c26254fe5681454 (diff)
downloadotp-c61fe198825316de24e7b37620b3ebd8ebd81c6d.tar.gz
otp-c61fe198825316de24e7b37620b3ebd8ebd81c6d.tar.bz2
otp-c61fe198825316de24e7b37620b3ebd8ebd81c6d.zip
Fix SCTP linger option
inet:setopts(S, [{linger,{true,2}}]) returned {error,einval} for SCTP sockets. The inet_drv had a bug when checking the option size.
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/test/gen_sctp_SUITE.erl26
1 files changed, 22 insertions, 4 deletions
diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl
index fad8c7398b..0899a9e660 100644
--- a/lib/kernel/test/gen_sctp_SUITE.erl
+++ b/lib/kernel/test/gen_sctp_SUITE.erl
@@ -23,12 +23,16 @@
%%-compile(export_all).
--export([all/1,init_per_testcase/2,fin_per_testcase/2,
- basic/1,api_open_close/1,api_listen/1,api_connect_init/1,
- xfer_min/1,xfer_active/1]).
+-export([all/1,init_per_testcase/2,fin_per_testcase/2]).
+-export(
+ [basic/1,
+ api_open_close/1,api_listen/1,api_connect_init/1,api_opts/1,
+ xfer_min/1,xfer_active/1]).
all(suite) ->
- [basic,api_open_close,api_listen,api_connect_init,xfer_min,xfer_active].
+ [basic,
+ api_open_close,api_listen,api_connect_init,api_opts,
+ xfer_min,xfer_active].
init_per_testcase(_Func, Config) ->
Dog = test_server:timetrap(test_server:seconds(15)),
@@ -382,3 +386,17 @@ api_connect_init(Config) when is_list(Config) ->
?line ok = gen_sctp:close(Sa),
?line ok = gen_sctp:close(Sb),
ok.
+
+api_opts(doc) ->
+ "Test socket options";
+api_opts(suite) ->
+ [];
+api_opts(Config) when is_list(Config) ->
+ ?line {ok,S} = gen_sctp:open(0),
+ ?line OSType = os:type(),
+ ?line case {inet:setopts(S, [{linger,{true,2}}]),OSType} of
+ {ok,_} ->
+ ok;
+ {{error,einval},{unix,sunos}} ->
+ ok
+ end.