]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: resolvers: renames resolvers DNS_UPD_* returncodes to RSLV_UPD_*
authorEmeric Brun <ebrun@haproxy.com>
Wed, 23 Dec 2020 17:17:31 +0000 (18:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 13 Feb 2021 08:43:18 +0000 (09:43 +0100)
This patch renames some #defines prefixes from DNS to RSLV.

include/haproxy/dns-t.h
src/dns.c
src/server.c

index 48a3952a1ecd09b1adf5104062ee8868a697e36f..a542d45dcbde5a3c4ee5a892f179499a8f8c47aa 100644 (file)
@@ -335,16 +335,16 @@ enum {
  * preference
  */
 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
                                    * 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
                                    * matching preference was found */
-       DNS_UPD_CNAME,            /* CNAME without any IP provided in the response */
-       DNS_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 */
-       DNS_UPD_OBSOLETE_IP,      /* The server IP was obsolete, and no other IP was found */
+       RSLV_UPD_CNAME,            /* CNAME without any IP provided in the response */
+       RSLV_UPD_NAME_ERROR,       /* name in the response did not match the query */
+       RSLV_UPD_NO_IP_FOUND,      /* no IP could be found in the response */
+       RSLV_UPD_OBSOLETE_IP,      /* The server IP was obsolete, and no other IP was found */
 };
 
 struct proxy;
index 5db3653a97c24275c5a6a06fbfc2e40125e88cf7..a48f685a39466ed21064c56a89320ea8cbb3fa55 100644 (file)
--- a/src/dns.c
+++ b/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:
  *   - <dns_p> contains an error free DNS response
  * 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,
                              struct resolv_options *resolv_opts, void *currentip,
@@ -1435,14 +1435,14 @@ int dns_get_ip_from_response(struct resolv_response *r_res,
                                newip6 = ip;
                        currentip_found = currentip_sel;
                        if (score == 15)
-                               return DNS_UPD_NO;
+                               return RSLV_UPD_NO;
                        max_score = score;
                }
        } /* list for each record entries */
 
        /* No IP found in the response */
        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 */
        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 */
-       return DNS_UPD_NO;
+       return RSLV_UPD_NO;
 
  not_found:
        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);
                break;
        }
-       return DNS_UPD_SRVIP_NOT_FOUND;
+       return RSLV_UPD_SRVIP_NOT_FOUND;
 }
 
 /* Turns a domain name label into a string.
index 03b107bdaef9a1115b69fd7074b190de9108c985..d33f3deeae045b467bb56aa8db18e6b5dd611a4a 100644 (file)
@@ -4019,20 +4019,20 @@ int snr_resolution_cb(struct resolv_requester *requester, struct dns_counters *c
                                       &firstip_sin_family, s);
 
        switch (ret) {
-               case DNS_UPD_NO:
+               case RSLV_UPD_NO:
                        goto update_status;
 
-               case DNS_UPD_SRVIP_NOT_FOUND:
+               case RSLV_UPD_SRVIP_NOT_FOUND:
                        goto save_ip;
 
-               case DNS_UPD_CNAME:
+               case RSLV_UPD_CNAME:
                        goto invalid;
 
-               case DNS_UPD_NO_IP_FOUND:
+               case RSLV_UPD_NO_IP_FOUND:
                        has_no_ip = 1;
                        goto update_status;
 
-               case DNS_UPD_NAME_ERROR:
+               case RSLV_UPD_NAME_ERROR:
                        /* update resolution status to OTHER error type */
                        resolution->status = RSLV_STATUS_OTHER;
                        goto update_status;