]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: server: consider AF_UNSPEC as a valid address family
authorWilly Tarreau <w@1wt.eu>
Fri, 6 Jan 2017 18:18:32 +0000 (19:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 6 Jan 2017 18:21:37 +0000 (19:21 +0100)
The DNS code is written so as to support AF_UNSPEC to decide on the
server family based on responses, but unfortunately snr_resolution_cb()
considers it as invalid causing a DNS storm to happen when a server
arrives with this family.

This situation is not supposed to happen as long as unresolved addresses
are forced to AF_INET, but this will change with the upcoming fixes and
it's possible that it's not granted already when changing an address on
the CLI.

This fix must be backported to 1.7 and 1.6.

src/server.c

index d9e036836be64349d01d15810146479e6bb27d58..1551f7208e888ec03ecd1cb93777d911589595e1 100644 (file)
@@ -3009,6 +3009,9 @@ int snr_resolution_cb(struct dns_resolution *resolution, struct dns_nameserver *
                        serverip = &((struct sockaddr_in6 *)&s->addr)->sin6_addr.s6_addr;
                        break;
 
+               case AF_UNSPEC:
+                       break;
+
                default:
                        goto invalid;
        }