From: Christopher Faulet Date: Thu, 24 Jun 2021 13:26:03 +0000 (+0200) Subject: BUG/MINOR: resolvers: Reset server IP when no ip is found in the response X-Git-Tag: v2.5-dev1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8ce497aacd6871c6056baf5a30e04f021956a5c;p=thirdparty%2Fhaproxy.git BUG/MINOR: resolvers: Reset server IP when no ip is found in the response For A/AAAA resolution, if no ip is found for a server in the response, the server is set to RMAINT status. However, its address must also be reset. Otherwise, it is still reported by the cli on "show servers state" commands. This may be confusing. This patch may be backported as far as 2.0. --- diff --git a/src/server.c b/src/server.c index d63c3f1e38..2271b10b47 100644 --- a/src/server.c +++ b/src/server.c @@ -3436,8 +3436,8 @@ int snr_resolution_cb(struct resolv_requester *requester, struct dns_counters *c srv_update_addr(s, firstip, firstip_sin_family, (char *) chk->area); update_status: - - snr_update_srv_status(s, has_no_ip); + if (!snr_update_srv_status(s, has_no_ip) && has_no_ip) + memset(&s->addr, 0, sizeof(s->addr)); return 1; invalid: