From 3acfcd1aa10b933053e6398baba2eae2d32ae7a6 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 6 Jan 2017 19:18:32 +0100 Subject: [PATCH] BUG/MEDIUM: server: consider AF_UNSPEC as a valid address family 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server.c b/src/server.c index d9e036836..1551f7208 100644 --- a/src/server.c +++ b/src/server.c @@ -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; }