mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-07 09:42:34 +00:00
MINOR: resolvers: Reset server IP on error in resolv_get_ip_from_response()
If resolv_get_ip_from_response() returns an error (or an unexpected return value), 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. Note that it is a theorical patch because this code path does not exist. Thus it is not tagged as a BUG. This patch may be backported as far as 2.0.
This commit is contained in:
parent
a8ce497aac
commit
07ecff589d
@ -3408,9 +3408,6 @@ int snr_resolution_cb(struct resolv_requester *requester, struct dns_counters *c
|
||||
case RSLV_UPD_SRVIP_NOT_FOUND:
|
||||
goto save_ip;
|
||||
|
||||
case RSLV_UPD_CNAME:
|
||||
goto invalid;
|
||||
|
||||
case RSLV_UPD_NO_IP_FOUND:
|
||||
has_no_ip = 1;
|
||||
goto update_status;
|
||||
@ -3418,9 +3415,11 @@ int snr_resolution_cb(struct resolv_requester *requester, struct dns_counters *c
|
||||
case RSLV_UPD_NAME_ERROR:
|
||||
/* update resolution status to OTHER error type */
|
||||
resolution->status = RSLV_STATUS_OTHER;
|
||||
has_no_ip = 1;
|
||||
goto update_status;
|
||||
|
||||
default:
|
||||
has_no_ip = 1;
|
||||
goto invalid;
|
||||
|
||||
}
|
||||
@ -3445,7 +3444,8 @@ int snr_resolution_cb(struct resolv_requester *requester, struct dns_counters *c
|
||||
counters->invalid++;
|
||||
goto 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 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user