aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2016-09-13 09:40:01 +0200
committerRaimo Niskanen <[email protected]>2016-09-14 08:42:15 +0200
commit8d5a41b9eeae54d1135c570878fecc2ad3ad1d8e (patch)
tree8bc006b1db3f774d4e5e3f5c91ac8db1acefac53
parent82d673f8c9dd39cc78cb7567fe59ebda2b88bf2d (diff)
downloadotp-8d5a41b9eeae54d1135c570878fecc2ad3ad1d8e.tar.gz
otp-8d5a41b9eeae54d1135c570878fecc2ad3ad1d8e.tar.bz2
otp-8d5a41b9eeae54d1135c570878fecc2ad3ad1d8e.zip
Tune 'tclass' semantics
-rw-r--r--erts/emulator/drivers/common/inet_drv.c11
-rw-r--r--lib/kernel/test/gen_tcp_api_SUITE.erl2
2 files changed, 4 insertions, 9 deletions
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index 14fb1fada6..1885338ce5 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -6231,16 +6231,14 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr, int len)
#else
continue;
#endif
- case INET_OPT_TCLASS:
#if defined(IPV6_TCLASS) && defined(SOL_IPV6)
+ case INET_OPT_TCLASS:
proto = SOL_IPV6;
type = IPV6_TCLASS;
propagate = 1;
DEBUGF(("inet_set_opts(%ld): s=%d, IPV6_TCLASS=%d\r\n",
(long)desc->port, desc->s, ival));
break;
-#else
- continue;
#endif
case TCP_OPT_NODELAY:
@@ -6675,8 +6673,8 @@ static int sctp_set_opts(inet_descriptor* desc, char* ptr, int len)
continue; /* Option not supported -- ignore it */
# endif
- case INET_OPT_TCLASS:
# if defined(IPV6_TCLASS) && defined(SOL_IPV6)
+ case INET_OPT_TCLASS:
{
arg.ival= get_int32 (curr); curr += 4;
proto = SOL_IPV6;
@@ -6685,8 +6683,6 @@ static int sctp_set_opts(inet_descriptor* desc, char* ptr, int len)
arg_sz = sizeof ( arg.ival);
break;
}
-# else
- continue; /* Option not supported -- ignore it */
# endif
@@ -7197,8 +7193,7 @@ static ErlDrvSSizeT inet_fill_opts(inet_descriptor* desc,
type = IPV6_TCLASS;
break;
#else
- *ptr++ = opt;
- put_int32(0, ptr);
+ TRUNCATE_TO(0,ptr);
continue;
#endif
case INET_OPT_REUSEADDR:
diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl
index d630032480..92a74465b7 100644
--- a/lib/kernel/test/gen_tcp_api_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_api_SUITE.erl
@@ -536,7 +536,7 @@ t_accept_inet6_tclass(Config) when is_list(Config) ->
ok = gen_tcp:close(L),
ok;
{error,_} ->
- {skip,"IPv6 not supported"}
+ {skip,"IPv6 TCLASS not supported"}
end.