+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
#include <ctype.h>
#include <errno.h>
-#define RESOLVSORT
-
#ifndef LOG_AUTH
# define LOG_AUTH 0
#endif
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
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"
*/
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)
}
}
-#ifdef RESOLVSORT
extern void
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) */
errnop, h_errnop, NULL);
}
-#ifdef RESOLVSORT
static void addrsort (char **ap, int num);
static void
else
break;
}
-#endif
static enum nss_status
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"
*/
if (_res.nsort && haveanswer > 1 && qtype == T_A)
addrsort (host_data->h_addr_ptrs, haveanswer);
-#endif /*RESOLVSORT*/
if (result->h_name == NULL)
{
#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))
int have_serv6 = 0;
int haveenv = 0;
int havesearch = 0;
-#ifdef RESOLVSORT
int nsort = 0;
char *net;
-#endif
#ifndef RFC1535
int dots;
#endif
}
continue;
}
-#ifdef RESOLVSORT
if (MATCH(buf, "sortlist")) {
struct in_addr a;
}
continue;
}
-#endif
if (MATCH(buf, "options")) {
res_setoptions(statp, buf + sizeof("options") - 1, "conf");
continue;
/* 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)) {
}
}
-#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
return (htonl(IN_CLASSB_NET));
return (htonl(IN_CLASSC_NET));
}
-#endif
u_int
res_randomid(void) {