]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: resolvers: Consider server to have no IP on DNS resolution error
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Mar 2021 14:39:16 +0000 (15:39 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 12 Mar 2021 15:43:37 +0000 (16:43 +0100)
When an error is received for a DNS resolution, for instance a NXDOMAIN
error, the server must be considered to have no address when its status is
updated, not the opposite.

Concretly, because this parameter is not used on error path in
snr_update_srv_status(), there is no impact.

This patch must be backported as far as 1.8.

src/server.c

index ed9925ecc3d973a7fd8533328882496f3fb05a00..18996a016fa0eb06cd323b6652c1caf1ebc33d13 100644 (file)
@@ -3293,7 +3293,7 @@ int snr_resolution_error_cb(struct resolv_requester *requester, int error_code)
        if (!s)
                return 1;
        HA_SPIN_LOCK(SERVER_LOCK, &s->lock);
-       snr_update_srv_status(s, 0);
+       snr_update_srv_status(s, 1);
        memset(&s->addr, 0, sizeof(s->addr));
        HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
        return 1;