mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
BUG/MINOR: resolvers: Reset server address on DNS error only on status change
When a DNS resolution error is detected, in snr_resolution_error_cb(), the server address must be reset only if the server status has changed. It this case, it means the server is set to RMAINT. Thus the server address may by reset. This patch fixes a bug introduced by commit d127ffa9f ("BUG/MEDIUM: resolvers: Reset address for unresolved servers"). It must be backported as far as 2.0.
This commit is contained in:
parent
bd0227c109
commit
5130c21fbb
@ -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, 1);
|
||||
if (!snr_update_srv_status(s, 1))
|
||||
memset(&s->addr, 0, sizeof(s->addr));
|
||||
HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user