Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/dist/bind Pull up revisions 1.3-1.4 (requested by itojun):



details:   https://anonhg.NetBSD.org/src/rev/c99d60de19dc
branches:  netbsd-1-5
changeset: 493178:c99d60de19dc
user:      he <he%NetBSD.org@localhost>
date:      Mon Jul 01 17:14:06 2002 +0000

description:
Pull up revisions 1.3-1.4 (requested by itojun):
  Update BIND to version 8.3.3.

diffstat:

 dist/bind/bin/dnsquery/dnsquery.c |    95 +-
 dist/bind/bin/irpd/irpd.c         |   528 +++++++++++----
 dist/bind/bin/named/db_defs.h     |    29 +-
 dist/bind/bin/named/db_ixfr.c     |   119 ++-
 dist/bind/bin/named/named.h       |    10 +-
 dist/bind/bin/named/ns_init.c     |    76 +-
 dist/bind/bin/named/ns_xfr.c      |    63 +-
 dist/bind/bin/nsupdate/nsupdate.c |    14 +-
 dist/bind/lib/dst/cylink_link.c   |    22 +-
 dist/bind/lib/dst/eay_dss_link.c  |    34 +-
 dist/bind/lib/dst/prandom.c       |    46 +-
 dist/bind/lib/dst/rsaref_link.c   |    28 +-
 dist/bind/lib/dst/support.c       |    34 +-
 dist/bind/lib/irs/dns_ho.c        |  1175 +++++++++++++++++++++++++++++++++---
 dist/bind/lib/irs/gethostent.c    |   249 ++++++-
 dist/bind/lib/irs/getnameinfo.c   |   266 +++++--
 dist/bind/lib/irs/irp.c           |    16 +-
 dist/bind/lib/nameser/ns_parse.c  |    37 +-
 dist/bind/lib/nameser/ns_print.c  |    56 +-
 dist/bind/lib/resolv/res_init.c   |   250 +++++++-
 dist/bind/man/dnskeygen.1         |    34 +-
 dist/bind/man/dnsquery.1          |    38 +-
 22 files changed, 2507 insertions(+), 712 deletions(-)

diffs (truncated from 5745 to 300 lines):

diff -r 92001cc122a2 -r c99d60de19dc dist/bind/bin/dnsquery/dnsquery.c
--- a/dist/bind/bin/dnsquery/dnsquery.c Mon Jul 01 17:13:57 2002 +0000
+++ b/dist/bind/bin/dnsquery/dnsquery.c Mon Jul 01 17:14:06 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: dnsquery.c,v 1.1.1.1.8.1 2001/01/28 15:52:16 he Exp $  */
+/*     $NetBSD: dnsquery.c,v 1.1.1.1.8.2 2002/07/01 17:14:06 he Exp $  */
 
 #if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "Id: dnsquery.c,v 8.15 2000/12/23 08:14:32 vixie Exp";
+static const char rcsid[] = "Id: dnsquery.c,v 8.19 2002/04/12 03:03:48 marka Exp";
 #endif /* not lint */
 
 /*
@@ -32,7 +32,6 @@
 
 #include <errno.h>
 #include <netdb.h>
-#include <resolv.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -40,21 +39,54 @@
 
 #include "port_after.h"
 
+#include <resolv.h>
+
 extern int errno;
 extern int h_errno;
 extern char *h_errlist[];
 
 struct __res_state res;
 
+static int
+newserver(char *srv, union res_sockaddr_union *u, int ns, int max) {
+       struct addrinfo *answer = NULL;
+       struct addrinfo *cur = NULL;
+       struct addrinfo hint;
+       short port = htons(NAMESERVER_PORT);
+
+       memset(&hint, 0, sizeof(hint));
+       hint.ai_socktype = SOCK_DGRAM;
+       if (!getaddrinfo(srv, NULL, &hint, &answer)) {
+               for (cur = answer; cur != NULL; cur = cur->ai_next) {
+                       if (ns >= max)
+                               break;
+                       switch (cur->ai_addr->sa_family) {
+                       case AF_INET6:
+                               u[ns].sin6 =
+                                        *(struct sockaddr_in6*)cur->ai_addr;
+                               u[ns++].sin6.sin6_port = port;
+                               break;
+                       case AF_INET:
+                               u[ns].sin = *(struct sockaddr_in*)cur->ai_addr;
+                               u[ns++].sin6.sin6_port = port;
+                               break;
+                       }
+               }
+               freeaddrinfo(answer);
+       } else {
+               fprintf(stderr, "Bad nameserver (%s)\n", srv);
+               exit(1);
+       }
+       return (ns);
+}
+
 int
 main(int argc, char *argv[]) {
        char name[MAXDNAME];
        u_char answer[8*1024];
-       int c, n, i = 0;
-       u_int32_t ul;
+       int c, n;
        int nameservers = 0, class, type, len;
-       struct in_addr q_nsaddr[MAXNS];
-       struct hostent *q_nsname;
+       union res_sockaddr_union q_nsaddr[MAXNS];
        extern int optind, opterr;
        extern char *optarg;
        int stream = 0, debug = 0;
@@ -68,7 +100,7 @@
        /* if no args, exit */
        if (argc == 1) {
                fprintf(stderr, "Usage:  %s [-h] host [-n ns] [-t type] [-c class] [-r retry] [-p period] [-s] [-v] [-d] [-a]\n", argv[0]);
-               exit(-1);
+               exit(1);
        }
 
        /* handle args */
@@ -84,7 +116,7 @@
                case 'h' :      if (strlen(optarg) >= sizeof(name)) {
                                        fprintf(stderr,
                                                "Domain name too long (%s)\n", optarg);
-                                       exit(-1);
+                                       exit(1);
                                } else
                                        strcpy(name, optarg);
                                break;
@@ -98,7 +130,7 @@
                                        class = proto_class;
                                else {
                                    fprintf(stderr, "Bad class (%s)\n", optarg);
-                                       exit(-1);
+                                       exit(1);
                                }
                            }
                                break;
@@ -112,7 +144,7 @@
                                        type = proto_type;
                                else {
                                    fprintf(stderr, "Bad type (%s)\n", optarg);
-                                       exit(-1);
+                                       exit(1);
                                }
                            }
                                break;
@@ -137,37 +169,22 @@
                                                fprintf(stderr,
                                                        "res_ninit() failed\n"
                                                        );
-                                               exit(-1);
+                                               exit(1);
                                }
-                               if (nameservers >= MAXNS) break;
-                               (void) inet_aton(optarg,
-                                                &q_nsaddr[nameservers]);
-                               if (!inet_aton(optarg, (struct in_addr *)&ul)){
-                                       q_nsname = gethostbyname(optarg);
-                                       if (q_nsname == 0) {
-                                               fprintf(stderr,
-                                                      "Bad nameserver (%s)\n",
-                                                       optarg);
-                                               exit(-1);
-                                       }
-                                       memcpy(&q_nsaddr[nameservers],
-                                              q_nsname->h_addr, INADDRSZ);
-                               }
-                               else
-                                       q_nsaddr[nameservers].s_addr = ul;
-                               nameservers++;
+                               nameservers = newserver(optarg, q_nsaddr,
+                                                       nameservers, MAXNS);
                                break;
 
                default :       fprintf(stderr, 
                                "\tUsage:  %s [-n ns] [-h host] [-t type] [-c class] [-r retry] [-p period] [-s] [-v] [-d] [-a]\n", argv[0]);
-                               exit(-1);
+                               exit(1);
                }
        }
        if (optind < argc) {
                if (strlen(argv[optind]) >= sizeof(name)) {
                        fprintf(stderr,
                                "Domain name too long (%s)\n", argv[optind]);
-                       exit(-1);
+                       exit(1);
                } else {
                        strcpy(name, argv[optind]);
                }
@@ -178,7 +195,7 @@
        if (!(res.options & RES_INIT))
                if (res_ninit(&res) == -1) {
                        fprintf(stderr, "res_ninit() failed\n");
-                       exit(-1);
+                       exit(1);
                }
 
        /* 
@@ -191,14 +208,8 @@
                res.options |= RES_USEVC;
 
        /* if the -n flag was used, add them to the resolver's list */
-       if (nameservers != 0) {
-               res.nscount = nameservers;
-               for (i = nameservers - 1; i >= 0; i--) {
-                       res.nsaddr_list[i].sin_addr.s_addr = q_nsaddr[i].s_addr;
-                       res.nsaddr_list[i].sin_family = AF_INET;
-                       res.nsaddr_list[i].sin_port = htons(NAMESERVER_PORT);
-               }
-       }
+       if (nameservers != 0)
+               res_setservers(&res, q_nsaddr, nameservers);
 
        /*
         * if the -h arg is fully-qualified, use res_query() since
@@ -210,13 +221,13 @@
                if (n < 0) {
                        fprintf(stderr, "Query failed (h_errno = %d) : %s\n", 
                                h_errno, h_errlist[h_errno]);
-                       exit(-1);
+                       exit(1);
                }
        } else if ((n = res_nsearch(&res, name, class, type,
                                    answer, len)) < 0) {
                fprintf(stderr, "Query failed (h_errno = %d) : %s\n", 
                        h_errno, h_errlist[h_errno]);
-               exit(-1);
+               exit(1);
        }
        res_pquery(&res, answer, n, stdout);
        exit(0);
diff -r 92001cc122a2 -r c99d60de19dc dist/bind/bin/irpd/irpd.c
--- a/dist/bind/bin/irpd/irpd.c Mon Jul 01 17:13:57 2002 +0000
+++ b/dist/bind/bin/irpd/irpd.c Mon Jul 01 17:14:06 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irpd.c,v 1.1.1.1.8.1 2001/01/28 15:52:16 he Exp $      */
+/*     $NetBSD: irpd.c,v 1.1.1.1.8.2 2002/07/01 17:14:07 he Exp $      */
 
 /*
  * Copyright(c) 1999 by Internet Software Consortium.
@@ -39,7 +39,7 @@
 #endif
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "Id: irpd.c,v 1.10 2000/12/23 08:14:33 vixie Exp";
+static const char rcsid[] = "Id: irpd.c,v 1.13 2001/09/25 04:50:17 marka Exp";
 #endif /* LIBC_SCCS and not lint */
 
 /* Imports. */
@@ -116,7 +116,7 @@
        do{ if ((nd)->field == 0) {                                          \
                (nd)->field = (*(nd)->irs->field ## _map)(nd->irs);          \
                if ((nd)->field == 0) {                                      \
-                   char *msg = "net_data " #field " initialization failed"; \
+                   const char *msg = "net_data " #field " initialization failed"; \
                    ctl_response(sess, respcode, msg, CTL_EXIT, NULL,        \
                                 NULL, NULL, NULL, 0);                       \
                    return;                                                  \
@@ -151,103 +151,111 @@
 
 static void irpd_gethostbyname(struct ctl_sctx *ctx, struct ctl_sess *sess,
                               const struct ctl_verb *verb, const char *rest,
-                              u_int respflags, void *respctx, void *uctx);
+                              u_int respflags, const void *respctx,
+                              void *uctx);
 static void irpd_gethostbyname2(struct ctl_sctx *ctx, struct ctl_sess *sess,
                                const struct ctl_verb *verb, const char *rest,
-                               u_int respflags, void *respctx, void *uctx);
+                               u_int respflags, const void *respctx,
+                               void *uctx);
+                       
 static void irpd_gethostbyaddr(struct ctl_sctx *ctx, struct ctl_sess *sess,
                               const struct ctl_verb *verb, const char *rest,
-                              u_int respflags, void *respctx, void *uctx);
+                              u_int respflags, const void *respctx,
+                              void *uctx);
 static void irpd_gethostent(struct ctl_sctx *ctx, struct ctl_sess *sess,
                            const struct ctl_verb *verb, const char *rest,
-                           u_int respflags, void *respctx, void *uctx);
+                           u_int respflags, const void *respctx, void *uctx);
 static void irpd_sethostent(struct ctl_sctx *ctx, struct ctl_sess *sess,
                            const struct ctl_verb *verb, const char *rest,
-                           u_int respflags, void *respctx, void *uctx);
+                           u_int respflags, const void *respctx, void *uctx);
 static void irpd_getpwnam(struct ctl_sctx *ctx, struct ctl_sess *sess,
                          const struct ctl_verb *verb, const char *rest,
-                         u_int respflags, void *respctx, void *uctx);
+                         u_int respflags, const void *respctx, void *uctx);
 static void irpd_getpwuid(struct ctl_sctx *ctx, struct ctl_sess *sess,
                          const struct ctl_verb *verb, const char *rest,
-                         u_int respflags, void *respctx, void *uctx);
+                         u_int respflags, const void *respctx, void *uctx);
 static void irpd_getpwent(struct ctl_sctx *ctx, struct ctl_sess *sess,
                          const struct ctl_verb *verb, const char *rest,
-                         u_int respflags, void *respctx, void *uctx);
+                         u_int respflags, const void *respctx, void *uctx);
 static void irpd_setpwent(struct ctl_sctx *ctx, struct ctl_sess *sess,
                          const struct ctl_verb *verb, const char *rest,
-                         u_int respflags, void *respctx, void *uctx);
+                         u_int respflags, const void *respctx, void *uctx);
 static void irpd_getnetbyname(struct ctl_sctx *ctx, struct ctl_sess *sess,
                              const struct ctl_verb *verb, const char *rest,
-                             u_int respflags, void *respctx, void *uctx);
+                             u_int respflags, const void *respctx, void *uctx);
 static void irpd_getnetbyaddr(struct ctl_sctx *ctx, struct ctl_sess *sess,
                              const struct ctl_verb *verb, const char *rest,
-                             u_int respflags, void *respctx, void *uctx);
+                             u_int respflags, const void *respctx, void *uctx);
 static void irpd_getnetent(struct ctl_sctx *ctx, struct ctl_sess *sess,
                           const struct ctl_verb *verb, const char *rest,
-                          u_int respflags, void *respctx, void *uctx);
+                          u_int respflags, const void *respctx, void *uctx);
 static void irpd_setnetent(struct ctl_sctx *ctx, struct ctl_sess *sess,
                           const struct ctl_verb *verb, const char *rest,
-                          u_int respflags, void *respctx, void *uctx);
+                          u_int respflags, const void *respctx, void *uctx);
 static void irpd_getgrnam(struct ctl_sctx *ctx, struct ctl_sess *sess,
                          const struct ctl_verb *verb, const char *rest,
-                         u_int respflags, void *respctx, void *uctx);
+                         u_int respflags, const void *respctx, void *uctx);
 static void irpd_getgrgid(struct ctl_sctx *ctx, struct ctl_sess *sess,
                          const struct ctl_verb *verb, const char *rest,
-                         u_int respflags, void *respctx, void *uctx);
+                         u_int respflags, const void *respctx, void *uctx);
 static void irpd_getgrent(struct ctl_sctx *ctx, struct ctl_sess *sess,
                          const struct ctl_verb *verb, const char *rest,
-                         u_int respflags, void *respctx, void *uctx);
+                         u_int respflags, const void *respctx, void *uctx);
 static void irpd_setgrent(struct ctl_sctx *ctx, struct ctl_sess *sess,
                          const struct ctl_verb *verb, const char *rest,



Home | Main Index | Thread Index | Old Index