mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 16:57:00 +08:00
use IPV6_V6ONLY flag only when defined
This commit is contained in:
@@ -428,6 +428,7 @@ void set_worker_udp_opts(int fd, int family)
|
||||
{
|
||||
int y;
|
||||
|
||||
#ifdef IPV6_V6ONLY
|
||||
if (family == AF_INET6) {
|
||||
y = 1;
|
||||
/* avoid listen on ipv6 addresses failing
|
||||
@@ -435,6 +436,7 @@ int y;
|
||||
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY,
|
||||
(const void *) &y, sizeof(y));
|
||||
}
|
||||
#endif
|
||||
|
||||
y = 1;
|
||||
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const void *) &y, sizeof(y));
|
||||
|
||||
Reference in New Issue
Block a user