Browse Source

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 years ago
parent
commit
40e298b787
1 changed files with 1 additions and 1 deletions
  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 defined(USE_IPV6)
-			if (ip_version == 6) {
+			if (ip_version > 6) {
 				if (so.lsa.sa.sa_family == AF_INET6
 				    && setsockopt(so.sock,
 				                  IPPROTO_IPV6,