浏览代码

Fixing configuration of ports for IPv4/IPv6 dual host sockets

When checking for configuring a socket, if the port option indicates that
a dual host socket should be used (single socket to receive traffic from
IPv4 and IPv6 addresses, e.g., `+80`), the IP version returned is 10. To
signal that a socket should be used by both versions, the IPV6_ONLY socket
option should be set to 0. Prior to this commit, `set_ports_option` looked
for an IP version equal to 6 to set the option to zero, but should be
looking for a version of 10.
Jim Evans 7 年之前
父节点
当前提交
40e298b787
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -13810,7 +13810,7 @@ set_ports_option(struct mg_context *phys_ctx)
 
 
 		if (ip_version > 4) {
 		if (ip_version > 4) {
 #if defined(USE_IPV6)
 #if defined(USE_IPV6)
-			if (ip_version == 6) {
+			if (ip_version > 6) {
 				if (so.lsa.sa.sa_family == AF_INET6
 				if (so.lsa.sa.sa_family == AF_INET6
 				    && setsockopt(so.sock,
 				    && setsockopt(so.sock,
 				                  IPPROTO_IPV6,
 				                  IPPROTO_IPV6,