Merge pull request #730 from luisdallos/win81-unsup-sockopt-fix

Fix startup failure on Windows 8.1 due to unsupported IPV6_USER_MTU socket option being set
This commit is contained in:
Wouter Wijngaards 2022-08-02 16:12:16 +02:00 committed by GitHub
commit e738ec31ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -511,12 +511,14 @@ create_udp_sock(int family, int socktype, struct sockaddr* addr,
* instead which is writable; IPV6_MTU is readonly there. */
if (setsockopt(s, IPPROTO_IPV6, IPV6_USER_MTU,
(void*)&mtu, (socklen_t)sizeof(mtu)) < 0) {
log_err("setsockopt(..., IPV6_USER_MTU, ...) failed: %s",
wsa_strerror(WSAGetLastError()));
sock_close(s);
*noproto = 0;
*inuse = 0;
return -1;
if (WSAGetLastError() != WSAENOPROTOOPT) {
log_err("setsockopt(..., IPV6_USER_MTU, ...) failed: %s",
wsa_strerror(WSAGetLastError()));
sock_close(s);
*noproto = 0;
*inuse = 0;
return -1;
}
}
# endif /* USE_WINSOCK */
# endif /* IPv6 MTU */