aboutsummaryrefslogtreecommitdiff
path: root/resolv/res_mkquery.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-07-26 10:14:02 +0000
committerRoland McGrath <roland@gnu.org>1995-07-26 10:14:02 +0000
commit3d61b63cc722951e3a5261e6bc3f0488eb35d441 (patch)
tree19195b08df7f3f992f0d539205df60ff690cd0f6 /resolv/res_mkquery.c
parent958f803fc021993cc2ee1d4157d0092b830368aa (diff)
downloadglibc-3d61b63cc722951e3a5261e6bc3f0488eb35d441.tar
glibc-3d61b63cc722951e3a5261e6bc3f0488eb35d441.tar.gz
glibc-3d61b63cc722951e3a5261e6bc3f0488eb35d441.tar.bz2
glibc-3d61b63cc722951e3a5261e6bc3f0488eb35d441.zip
* asia, backward, europe, leapseconds, southamerica: New data from
ADO's 95e. * inet/Makefile (routines): Removed inet_addr. * inet/inet_addr.c: Moved to resolv/ subdirectory. * resolv/Makefile (routines): Added inet_addr. * resolv/inet_addr.c: Incorporated from BIND 4.9.3-BETA24 release. * resolv/gethnamaddr.c: Likewise. * resolv/getnetbyaddr.c: Likewise. * resolv/getnetbyname.c: Likewise. * resolv/getnetent.c: Likewise. * resolv/getnetnamadr.c: Likewise. * resolv/herror.c: Likewise. * resolv/nsap_addr.c: Likewise. * resolv/res_comp.c: Likewise. * resolv/res_debug.c: Likewise. * resolv/res_init.c: Likewise. * resolv/res_mkquery.c: Likewise. * resolv/res_query.c: Likewise. * resolv/res_send.c: Likewise. * resolv/resolv.h: Likewise. * resolv/sethostent.c: Likewise. * resolv/arpa/nameser.h: Likewise. * inet/netdb.h: Incorporated from BIND 4.9.3-BETA24 release. [__GNU_LIBRARY__]: Include <rpc/netdb.h> instead of repeating its declarations (and doing so only #ifdef sun!). * posix/sys/types.h [__USE_BSD] (__BIT_TYPES_DEFINED__): New macro. [__USE_BSD] [__GNUC__] (int64_t, u_int64_t, register_t): New typedefs.
Diffstat (limited to 'resolv/res_mkquery.c')
-rw-r--r--resolv/res_mkquery.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/resolv/res_mkquery.c b/resolv/res_mkquery.c
index 0695670925..33f788eb2f 100644
--- a/resolv/res_mkquery.c
+++ b/resolv/res_mkquery.c
@@ -63,6 +63,7 @@ static char rcsid[] = "$Id$";
#include <arpa/nameser.h>
#include <stdio.h>
+#include <netdb.h>
#include <resolv.h>
#if defined(BSD) && (BSD >= 199103)
# include <string.h>
@@ -92,18 +93,20 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
register HEADER *hp;
register u_char *cp;
register int n;
+#ifdef ALLOW_UPDATES
struct rrec *newrr = (struct rrec *) newrr_in;
+#endif
u_char *dnptrs[20], **dpp, **lastdnptr;
+ if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
+ h_errno = NETDB_INTERNAL;
+ return (-1);
+ }
#ifdef DEBUG
if (_res.options & RES_DEBUG)
printf(";; res_mkquery(%d, %s, %d, %d)\n",
op, dname, class, type);
#endif
- if (!(_res.options & RES_INIT)) {
- if (res_init() == -1)
- return (-1);
- }
/*
* Initialize header fields.
*/
@@ -113,7 +116,6 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
hp = (HEADER *) buf;
hp->id = htons(++_res.id);
hp->opcode = op;
- hp->pr = (_res.options & RES_PRIMARY) != 0;
hp->rd = (_res.options & RES_RECURSE) != 0;
hp->rcode = NOERROR;
cp = buf + HFIXEDSZ;