mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
MINOR: resolvers: renames resolvers DNS_UPD_* returncodes to RSLV_UPD_*
This patch renames some #defines prefixes from DNS to RSLV.
This commit is contained in:
parent
30c766ebbc
commit
456de77bdb
@ -335,16 +335,16 @@ enum {
|
|||||||
* preference
|
* preference
|
||||||
*/
|
*/
|
||||||
enum {
|
enum {
|
||||||
DNS_UPD_NO = 1, /* provided IP was found and preference is matched
|
RSLV_UPD_NO = 1, /* provided IP was found and preference is matched
|
||||||
* OR provided IP found and preference is not matched, but no IP
|
* OR provided IP found and preference is not matched, but no IP
|
||||||
* matching preference was found */
|
* matching preference was found */
|
||||||
DNS_UPD_SRVIP_NOT_FOUND, /* provided IP not found
|
RSLV_UPD_SRVIP_NOT_FOUND, /* provided IP not found
|
||||||
* OR provided IP found and preference is not match and an IP
|
* OR provided IP found and preference is not match and an IP
|
||||||
* matching preference was found */
|
* matching preference was found */
|
||||||
DNS_UPD_CNAME, /* CNAME without any IP provided in the response */
|
RSLV_UPD_CNAME, /* CNAME without any IP provided in the response */
|
||||||
DNS_UPD_NAME_ERROR, /* name in the response did not match the query */
|
RSLV_UPD_NAME_ERROR, /* name in the response did not match the query */
|
||||||
DNS_UPD_NO_IP_FOUND, /* no IP could be found in the response */
|
RSLV_UPD_NO_IP_FOUND, /* no IP could be found in the response */
|
||||||
DNS_UPD_OBSOLETE_IP, /* The server IP was obsolete, and no other IP was found */
|
RSLV_UPD_OBSOLETE_IP, /* The server IP was obsolete, and no other IP was found */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct proxy;
|
struct proxy;
|
||||||
|
10
src/dns.c
10
src/dns.c
@ -1323,7 +1323,7 @@ static int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend,
|
|||||||
* The following tasks are the responsibility of the caller:
|
* The following tasks are the responsibility of the caller:
|
||||||
* - <dns_p> contains an error free DNS response
|
* - <dns_p> contains an error free DNS response
|
||||||
* For both cases above, dns_validate_dns_response is required
|
* For both cases above, dns_validate_dns_response is required
|
||||||
* returns one of the DNS_UPD_* code
|
* returns one of the RSLV_UPD_* code
|
||||||
*/
|
*/
|
||||||
int dns_get_ip_from_response(struct resolv_response *r_res,
|
int dns_get_ip_from_response(struct resolv_response *r_res,
|
||||||
struct resolv_options *resolv_opts, void *currentip,
|
struct resolv_options *resolv_opts, void *currentip,
|
||||||
@ -1435,14 +1435,14 @@ int dns_get_ip_from_response(struct resolv_response *r_res,
|
|||||||
newip6 = ip;
|
newip6 = ip;
|
||||||
currentip_found = currentip_sel;
|
currentip_found = currentip_sel;
|
||||||
if (score == 15)
|
if (score == 15)
|
||||||
return DNS_UPD_NO;
|
return RSLV_UPD_NO;
|
||||||
max_score = score;
|
max_score = score;
|
||||||
}
|
}
|
||||||
} /* list for each record entries */
|
} /* list for each record entries */
|
||||||
|
|
||||||
/* No IP found in the response */
|
/* No IP found in the response */
|
||||||
if (!newip4 && !newip6)
|
if (!newip4 && !newip6)
|
||||||
return DNS_UPD_NO_IP_FOUND;
|
return RSLV_UPD_NO_IP_FOUND;
|
||||||
|
|
||||||
/* Case when the caller looks first for an IPv4 address */
|
/* Case when the caller looks first for an IPv4 address */
|
||||||
if (family_priority == AF_INET) {
|
if (family_priority == AF_INET) {
|
||||||
@ -1485,7 +1485,7 @@ int dns_get_ip_from_response(struct resolv_response *r_res,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* No reason why we should change the server's IP address */
|
/* No reason why we should change the server's IP address */
|
||||||
return DNS_UPD_NO;
|
return RSLV_UPD_NO;
|
||||||
|
|
||||||
not_found:
|
not_found:
|
||||||
list_for_each_entry(record, &r_res->answer_list, list) {
|
list_for_each_entry(record, &r_res->answer_list, list) {
|
||||||
@ -1495,7 +1495,7 @@ int dns_get_ip_from_response(struct resolv_response *r_res,
|
|||||||
LIST_ADDQ(&r_res->answer_list, &record->list);
|
LIST_ADDQ(&r_res->answer_list, &record->list);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return DNS_UPD_SRVIP_NOT_FOUND;
|
return RSLV_UPD_SRVIP_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Turns a domain name label into a string.
|
/* Turns a domain name label into a string.
|
||||||
|
10
src/server.c
10
src/server.c
@ -4019,20 +4019,20 @@ int snr_resolution_cb(struct resolv_requester *requester, struct dns_counters *c
|
|||||||
&firstip_sin_family, s);
|
&firstip_sin_family, s);
|
||||||
|
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case DNS_UPD_NO:
|
case RSLV_UPD_NO:
|
||||||
goto update_status;
|
goto update_status;
|
||||||
|
|
||||||
case DNS_UPD_SRVIP_NOT_FOUND:
|
case RSLV_UPD_SRVIP_NOT_FOUND:
|
||||||
goto save_ip;
|
goto save_ip;
|
||||||
|
|
||||||
case DNS_UPD_CNAME:
|
case RSLV_UPD_CNAME:
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
case DNS_UPD_NO_IP_FOUND:
|
case RSLV_UPD_NO_IP_FOUND:
|
||||||
has_no_ip = 1;
|
has_no_ip = 1;
|
||||||
goto update_status;
|
goto update_status;
|
||||||
|
|
||||||
case DNS_UPD_NAME_ERROR:
|
case RSLV_UPD_NAME_ERROR:
|
||||||
/* update resolution status to OTHER error type */
|
/* update resolution status to OTHER error type */
|
||||||
resolution->status = RSLV_STATUS_OTHER;
|
resolution->status = RSLV_STATUS_OTHER;
|
||||||
goto update_status;
|
goto update_status;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user