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.
This commit is contained in:
Willy Tarreau 2017-01-06 19:18:32 +01:00
parent d7dad1bc49
commit 3acfcd1aa1

View 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;
}