Don't try to do IPV6_V6ONLY on OpenBSD either.
setsockopt(3) returns an error if passing 0 to this option (which we do if no address family is specified when we bind to the wildcard address, say by invoking "iperf3 -s" with no other options). This is because OpenBSD explicitly does not support IPv4-mapped addresses, so even though the IPV6_V6ONLY socket options exists, it only works with a non-zero argument. Fixes #196.
Этот коммит содержится в:
родитель
147d3369a0
Коммит
bef5ef87f5
@ -155,7 +155,7 @@ iperf_sctp_listen(struct iperf_test *test)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef IPV6_V6ONLY
|
||||
#if defined(IPV6_V6ONLY) && !defined(__OpenBSD__)
|
||||
if (test->settings->domain == AF_UNSPEC || test->settings->domain == AF_INET6) {
|
||||
if (test->settings->domain == AF_UNSPEC)
|
||||
opt = 0;
|
||||
|
@ -216,7 +216,7 @@ iperf_tcp_listen(struct iperf_test *test)
|
||||
i_errno = IEREUSEADDR;
|
||||
return -1;
|
||||
}
|
||||
#ifdef IPV6_V6ONLY
|
||||
#if defined(IPV6_V6ONLY) && !defined(__OpenBSD__)
|
||||
if (test->settings->domain == AF_UNSPEC || test->settings->domain == AF_INET6) {
|
||||
if (test->settings->domain == AF_UNSPEC)
|
||||
opt = 0;
|
||||
|
@ -146,9 +146,12 @@ netannounce(int domain, int proto, char *local, int port)
|
||||
/*
|
||||
* If we got an IPv6 socket, figure out if it should accept IPv4
|
||||
* connections as well. We do that if and only if no address
|
||||
* family was specified explicitly.
|
||||
* family was specified explicitly. Note that we can only
|
||||
* do this if the IPV6_V6ONLY socket option is supported. Also,
|
||||
* OpenBSD explicitly omits support for IPv4-mapped addresses,
|
||||
* even though it implements IPV6_V6ONLY.
|
||||
*/
|
||||
#ifdef IPV6_V6ONLY
|
||||
#if defined(IPV6_V6ONLY) && !defined(__OpenBSD__)
|
||||
if (res->ai_family == AF_INET6 && (domain == AF_UNSPEC || domain == AF_INET6)) {
|
||||
if (domain == AF_UNSPEC)
|
||||
opt = 0;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user