ipv6_fixes.diff 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. diff --git a/thirdparty/libwebsockets/plat/lws-plat-unix.c b/thirdparty/libwebsockets/plat/lws-plat-unix.c
  2. index 7dba3bd82..d1bca8b5d 100644
  3. --- a/thirdparty/libwebsockets/plat/lws-plat-unix.c
  4. +++ b/thirdparty/libwebsockets/plat/lws-plat-unix.c
  5. @@ -328,6 +328,11 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, int fd)
  6. int optval = 1;
  7. socklen_t optlen = sizeof(optval);
  8. +#ifdef LWS_WITH_IPV6
  9. + optval = 0;
  10. + setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (const void*)&optval, optlen);
  11. +#endif
  12. +
  13. #if defined(__APPLE__) || \
  14. defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
  15. defined(__NetBSD__) || \
  16. diff --git a/thirdparty/libwebsockets/plat/lws-plat-win.c b/thirdparty/libwebsockets/plat/lws-plat-win.c
  17. index 1850b6425..26caab2cd 100644
  18. --- a/thirdparty/libwebsockets/plat/lws-plat-win.c
  19. +++ b/thirdparty/libwebsockets/plat/lws-plat-win.c
  20. @@ -348,6 +348,11 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd)
  21. struct protoent *tcp_proto;
  22. #endif
  23. +#ifdef LWS_WITH_IPV6
  24. + optval = 0;
  25. + setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (const void*)&optval, optlen);
  26. +#endif
  27. +
  28. if (vhost->ka_time) {
  29. /* enable keepalive on this socket */
  30. optval = 1;