1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

TCP/UDP Listen sockets can now be set to IPv6 only

(cherry picked from commit eb27e993f0)
This commit is contained in:
Fabio Alessandrelli
2016-10-28 23:11:53 +02:00
parent a2048efd72
commit 754e9aa60a
6 changed files with 50 additions and 8 deletions

View File

@@ -56,8 +56,8 @@ static int _socket_create(IP_Address::AddrType p_type, int type, int protocol) {
if(family == AF_INET6) {
// Ensure IPv4 over IPv6 is enabled
int v6_only = 0;
if(setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&v6_only, sizeof(v6_only)) != 0) {
int no = 0;
if(setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&no, sizeof(no)) != 0) {
WARN_PRINT("Unable to set IPv4 address mapping over IPv6");
}
}