Explorar o código

fix: set IPV6_V6ONLY for (#409)

ithewei %!s(int64=2) %!d(string=hai) anos
pai
achega
652d82b0ca
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      base/hsocket.h

+ 1 - 1
base/hsocket.h

@@ -192,7 +192,7 @@ HV_INLINE int udp_broadcast(int sockfd, int on DEFAULT(1)) {
 
 HV_INLINE int ip_v6only(int sockfd, int on DEFAULT(1)) {
 #ifdef IPV6_V6ONLY
-    return setsockopt(sockfd, IPPROTO_IP, IPV6_V6ONLY, (const char*)&on, sizeof(int));
+    return setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&on, sizeof(int));
 #else
     return 0;
 #endif