]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
resolv: Remove RESOLVSORT preprocess conditionals
authorFlorian Weimer <fweimer@redhat.com>
Thu, 28 Apr 2016 09:27:49 +0000 (11:27 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 28 Apr 2016 10:53:51 +0000 (12:53 +0200)
ChangeLog
resolv/gethnamaddr.c
resolv/nss_dns/dns-host.c
resolv/res_init.c

index 55ed91451896a7a005a511f542c5ed9a7091c3f1..47ef7a0901a022e587527fd48aa3c34c6203d2f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-04-28  Florian Weimer  <fweimer@redhat.com>
+
+       * resolv/gethnamaddr.c (RESOLVSORT): Do not define.  Remove
+       RESOLVSORT preprocessor conditionals.
+       * resolv/nss_dns/dns-host.c: Likewise.
+       * resolv/res_init.c: Likewise.
+
 2016-04-28  Florian Weimer  <fweimer@redhat.com>
 
        * resolv/res_data.c: Remove code conditional on BIND_UPDATE.  It
index 2e92df81c83bfef3658f45f4f77dbebad76a5265..2c7131392e2aadc6ab849dda8376b792f5e83d0a 100644 (file)
@@ -67,8 +67,6 @@
 #include <ctype.h>
 #include <errno.h>
 
-#define RESOLVSORT
-
 #ifndef LOG_AUTH
 # define LOG_AUTH 0
 #endif
@@ -107,9 +105,7 @@ static int stayopen = 0;
 static void map_v4v6_address (const char *src, char *dst) __THROW;
 static void map_v4v6_hostent (struct hostent *hp, char **bp, int *len) __THROW;
 
-#ifdef RESOLVSORT
 extern void addrsort (char **, int) __THROW;
-#endif
 
 #if PACKETSZ > 65536
 #define        MAXPACKET       PACKETSZ
@@ -434,7 +430,6 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
        if (haveanswer) {
                *ap = NULL;
                *hap = NULL;
-# if defined(RESOLVSORT)
                /*
                 * Note: we sort even if host can take only one address
                 * in its return structures - should give it the "best"
@@ -442,7 +437,6 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
                 */
                if (_res.nsort && haveanswer > 1 && qtype == T_A)
                        addrsort(h_addr_ptrs, haveanswer);
-# endif /*RESOLVSORT*/
                if (!host.h_name) {
                        n = strlen(qname) + 1;  /* for the \0 */
                        if (n > buflen || n >= MAXHOSTNAMELEN)
@@ -929,7 +923,6 @@ map_v4v6_hostent (struct hostent *hp, char **bpp, int *lenp)
        }
 }
 
-#ifdef RESOLVSORT
 extern void
 addrsort (char **ap, int num)
 {
@@ -970,7 +963,6 @@ addrsort (char **ap, int num)
            needsort++;
        }
 }
-#endif
 
 #if defined(BSD43_BSD43_NFS) || defined(sun)
 /* some libc's out there are bound internally to these names (UMIPS) */
index 403a005812999475afa6c960d96df3265cf1124a..93fee1038ecc225cb28f82d6338d482a7482c9c1 100644 (file)
@@ -556,7 +556,6 @@ _nss_dns_gethostbyaddr_r (const void *addr, socklen_t len, int af,
                                    errnop, h_errnop, NULL);
 }
 
-#ifdef RESOLVSORT
 static void addrsort (char **ap, int num);
 
 static void
@@ -600,7 +599,6 @@ addrsort (char **ap, int num)
       else
        break;
 }
-#endif
 
 static enum nss_status
 getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
@@ -955,7 +953,6 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
     {
       *ap = NULL;
       *hap = NULL;
-#if defined RESOLVSORT
       /*
        * Note: we sort even if host can take only one address
        * in its return structures - should give it the "best"
@@ -963,7 +960,6 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
        */
       if (_res.nsort && haveanswer > 1 && qtype == T_A)
        addrsort (host_data->h_addr_ptrs, haveanswer);
-#endif /*RESOLVSORT*/
 
       if (result->h_name == NULL)
        {
index de96d84b5dddc7785602c58d638794837afc61c7..da1f79e7c07c131f165596abae2a8f5db8b095c1 100644 (file)
 #include <not-cancel.h>
 
 /* Options.  Should all be left alone. */
-#define RESOLVSORT
 #define RFC1535
 /* #undef DEBUG */
 
 static void res_setoptions (res_state, const char *, const char *)
      internal_function;
 
-#ifdef RESOLVSORT
 static const char sort_mask_chars[] = "/&";
 #define ISSORTMASK(ch) (strchr(sort_mask_chars, ch) != NULL)
 static u_int32_t net_mask (struct in_addr) __THROW;
-#endif
 
 #if !defined(isascii)  /* XXX - could be a function */
 # define isascii(c) (!(c & 0200))
@@ -134,10 +131,8 @@ __res_vinit(res_state statp, int preinit) {
        int have_serv6 = 0;
        int haveenv = 0;
        int havesearch = 0;
-#ifdef RESOLVSORT
        int nsort = 0;
        char *net;
-#endif
 #ifndef RFC1535
        int dots;
 #endif
@@ -328,7 +323,6 @@ __res_vinit(res_state statp, int preinit) {
                    }
                    continue;
                }
-#ifdef RESOLVSORT
                if (MATCH(buf, "sortlist")) {
                    struct in_addr a;
 
@@ -370,7 +364,6 @@ __res_vinit(res_state statp, int preinit) {
                    }
                    continue;
                }
-#endif
                if (MATCH(buf, "options")) {
                    res_setoptions(statp, buf + sizeof("options") - 1, "conf");
                    continue;
@@ -381,9 +374,7 @@ __res_vinit(res_state statp, int preinit) {
                /* We try IPv6 servers again.  */
                statp->ipv6_unavail = false;
            }
-#ifdef RESOLVSORT
            statp->nsort = nsort;
-#endif
            (void) fclose(fp);
        }
        if (__builtin_expect(statp->nscount == 0, 0)) {
@@ -524,7 +515,6 @@ res_setoptions(res_state statp, const char *options, const char *source) {
        }
 }
 
-#ifdef RESOLVSORT
 /* XXX - should really support CIDR which means explicit masks always. */
 /* XXX - should really use system's version of this */
 static u_int32_t
@@ -538,7 +528,6 @@ net_mask (struct in_addr in)
                return (htonl(IN_CLASSB_NET));
        return (htonl(IN_CLASSC_NET));
 }
-#endif
 
 u_int
 res_randomid(void) {