Source-Changes-HG archive

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

[src/trunk]: src sync with 8.3.2. 99% of conflicts were due to $NetBSD$ tag.



details:   https://anonhg.NetBSD.org/src/rev/361f5ba67f37
branches:  trunk
changeset: 533069:361f5ba67f37
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Jun 20 11:42:53 2002 +0000

description:
sync with 8.3.2.  99% of conflicts were due to $NetBSD$ tag.

diffstat:

 dist/bind/README                               |    19 +-
 dist/bind/bin/addr/addr.c                      |     2 +-
 dist/bind/bin/dig/dig.c                        |   345 ++++--
 dist/bind/bin/dnskeygen/dnskeygen.c            |    13 +-
 dist/bind/bin/dnsquery/dnsquery.c              |    75 +-
 dist/bind/bin/host/host.c                      |   406 +++++--
 dist/bind/bin/irpd/irpd.c                      |   527 +++++++---
 dist/bind/bin/irpd/irs-irpd.conf               |     3 +-
 dist/bind/bin/mkservdb/mkservdb.c              |    12 +-
 dist/bind/bin/named-bootconf/named-bootconf.sh |     7 +-
 dist/bind/bin/named-xfer/named-xfer.c          |  1172 ++++++++++-------------
 dist/bind/bin/named/db_defs.h                  |    27 +-
 dist/bind/bin/named/db_dump.c                  |    21 +-
 dist/bind/bin/named/db_func.h                  |    12 +-
 dist/bind/bin/named/db_glue.c                  |    75 +-
 dist/bind/bin/named/db_ixfr.c                  |   103 +-
 dist/bind/bin/named/db_load.c                  |   153 ++-
 dist/bind/bin/named/db_lookup.c                |     6 +-
 dist/bind/bin/named/db_save.c                  |    10 +-
 dist/bind/bin/named/db_sec.c                   |    92 +-
 dist/bind/bin/named/db_tsig.c                  |     8 +-
 dist/bind/bin/named/db_update.c                |    73 +-
 dist/bind/bin/named/named.conf                 |    32 +-
 dist/bind/bin/named/named.h                    |     9 +-
 dist/bind/bin/named/ns_config.c                |   199 ++-
 dist/bind/bin/named/ns_ctl.c                   |   192 +++-
 dist/bind/bin/named/ns_defs.h                  |    87 +-
 dist/bind/bin/named/ns_forw.c                  |   212 ++-
 dist/bind/bin/named/ns_func.h                  |    93 +-
 dist/bind/bin/named/ns_glob.h                  |     6 +-
 dist/bind/bin/named/ns_glue.c                  |    36 +-
 dist/bind/bin/named/ns_init.c                  |    13 +-
 dist/bind/bin/named/ns_ixfr.c                  |    71 +-
 dist/bind/bin/named/ns_lexer.c                 |    26 +-
 dist/bind/bin/named/ns_lexer.h                 |     8 +-
 dist/bind/bin/named/ns_main.c                  |   240 +++-
 dist/bind/bin/named/ns_maint.c                 |   133 +-
 dist/bind/bin/named/ns_ncache.c                |    22 +-
 dist/bind/bin/named/ns_notify.c                |    87 +-
 dist/bind/bin/named/ns_parser.y                |   203 ++-
 dist/bind/bin/named/ns_parseutil.c             |    11 +-
 dist/bind/bin/named/ns_parseutil.h             |     7 +-
 dist/bind/bin/named/ns_req.c                   |   568 +++++++++--
 dist/bind/bin/named/ns_resp.c                  |   409 +++++---
 dist/bind/bin/named/ns_signal.c                |    36 +-
 dist/bind/bin/named/ns_sort.c                  |    11 +-
 dist/bind/bin/named/ns_stats.c                 |     9 +-
 dist/bind/bin/named/ns_update.c                |   177 ++-
 dist/bind/bin/named/ns_xfr.c                   |    54 +-
 dist/bind/bin/ndc/ndc.c                        |    56 +-
 dist/bind/bin/nslookup/commands.l              |    37 +-
 dist/bind/bin/nslookup/debug.c                 |    42 +-
 dist/bind/bin/nslookup/getinfo.c               |   459 +++++++--
 dist/bind/bin/nslookup/list.c                  |    89 +-
 dist/bind/bin/nslookup/main.c                  |   287 ++++-
 dist/bind/bin/nslookup/nslookup.help           |     4 +-
 dist/bind/bin/nslookup/res.h                   |    43 +-
 dist/bind/bin/nslookup/send.c                  |    41 +-
 dist/bind/bin/nslookup/skip.c                  |     2 +-
 dist/bind/bin/nslookup/subr.c                  |    55 +-
 dist/bind/bin/nsupdate/nsupdate.c              |     8 +-
 dist/bind/bin/probe_ipv6                       |     3 +-
 dist/bind/include/arpa/nameser.h               |    27 +-
 dist/bind/include/arpa/nameser_compat.h        |     2 +-
 dist/bind/include/irs.h                        |    21 +-
 dist/bind/include/isc/assertions.h             |    10 +-
 dist/bind/include/isc/ctl.h                    |    14 +-
 dist/bind/include/isc/eventlib.h               |     2 +-
 dist/bind/include/isc/irpmarshall.h            |     2 +-
 dist/bind/include/isc/list.h                   |    16 +-
 dist/bind/include/isc/logging.h                |    14 +-
 dist/bind/include/isc/memcluster.h             |     2 +-
 dist/bind/include/isc/misc.h                   |    12 +-
 dist/bind/include/netdb.h                      |    32 +-
 dist/bind/include/port_after.h                 |   129 ++-
 dist/bind/include/port_before.h                |    12 +-
 dist/bind/include/resolv.h                     |    95 +-
 dist/bind/lib/dst/bsafe_link.c                 |    39 +-
 dist/bind/lib/dst/cylink_link.c                |    10 +-
 dist/bind/lib/dst/dst_api.c                    |    28 +-
 dist/bind/lib/dst/dst_internal.h               |    25 +-
 dist/bind/lib/dst/eay_dss_link.c               |    22 +-
 dist/bind/lib/dst/hmac_link.c                  |    12 +-
 dist/bind/lib/dst/md5.h                        |     4 +-
 dist/bind/lib/dst/md5_dgst.c                   |    10 +-
 dist/bind/lib/dst/prandom.c                    |    43 +-
 dist/bind/lib/dst/rsaref_link.c                |    17 +-
 dist/bind/lib/dst/support.c                    |    15 +-
 dist/bind/lib/inet/inet_addr.c                 |     2 +-
 dist/bind/lib/inet/inet_cidr_ntop.c            |     2 +-
 dist/bind/lib/inet/inet_cidr_pton.c            |   169 ++-
 dist/bind/lib/inet/inet_net_ntop.c             |   137 ++-
 dist/bind/lib/inet/inet_net_pton.c             |     2 +-
 dist/bind/lib/inet/inet_network.c              |     2 +-
 dist/bind/lib/inet/inet_ntop.c                 |     9 +-
 dist/bind/lib/inet/inet_pton.c                 |     2 +-
 dist/bind/lib/inet/nsap_addr.c                 |     9 +-
 dist/bind/lib/irs/dns.c                        |     6 +-
 dist/bind/lib/irs/dns_gr.c                     |     2 +-
 dist/bind/lib/irs/dns_ho.c                     |  1139 +++++++++++++++++++++--
 dist/bind/lib/irs/dns_nw.c                     |     2 +-
 dist/bind/lib/irs/dns_pr.c                     |     2 +-
 dist/bind/lib/irs/dns_pw.c                     |     2 +-
 dist/bind/lib/irs/dns_sv.c                     |    28 +-
 dist/bind/lib/irs/gai_strerror.c               |     2 +-
 dist/bind/lib/irs/gen.c                        |     9 +-
 dist/bind/lib/irs/gen_gr.c                     |    35 +-
 dist/bind/lib/irs/gen_ho.c                     |     2 +-
 dist/bind/lib/irs/gen_ng.c                     |     2 +-
 dist/bind/lib/irs/gen_p.h                      |     2 +-
 dist/bind/lib/irs/getaddrinfo.c                |     2 +-
 dist/bind/lib/irs/getgrent.c                   |     2 +-
 dist/bind/lib/irs/getgrent_r.c                 |     2 +-
 dist/bind/lib/irs/gethostent.c                 |   246 ++++-
 dist/bind/lib/irs/gethostent_r.c               |    45 +-
 dist/bind/lib/irs/getnameinfo.c                |   264 +++-
 dist/bind/lib/irs/getnetent.c                  |     9 +-
 dist/bind/lib/irs/getnetent_r.c                |     2 +-
 dist/bind/lib/irs/getnetgrent.c                |     2 +-
 dist/bind/lib/irs/getnetgrent_r.c              |     2 +-
 dist/bind/lib/irs/getprotoent.c                |     2 +-
 dist/bind/lib/irs/getprotoent_r.c              |     2 +-
 dist/bind/lib/irs/getpwent_r.c                 |     2 +-
 dist/bind/lib/irs/getservent.c                 |     2 +-
 dist/bind/lib/irs/getservent_r.c               |     2 +-
 dist/bind/lib/irs/hesiod.c                     |     6 +-
 dist/bind/lib/irs/irp.c                        |    14 +-
 dist/bind/lib/irs/irp_gr.c                     |     2 +-
 dist/bind/lib/irs/irp_ho.c                     |     2 +-
 dist/bind/lib/irs/irp_ng.c                     |     2 +-
 dist/bind/lib/irs/irp_p.h                      |     7 +-
 dist/bind/lib/irs/irp_pw.c                     |     2 +-
 dist/bind/lib/irs/irpmarshall.c                |    41 +-
 dist/bind/lib/irs/irs_data.c                   |    11 +-
 dist/bind/lib/irs/lcl.c                        |     6 +-
 dist/bind/lib/irs/lcl_gr.c                     |     2 +-
 dist/bind/lib/irs/lcl_ho.c                     |     2 +-
 dist/bind/lib/irs/lcl_ng.c                     |     2 +-
 dist/bind/lib/irs/lcl_nw.c                     |     2 +-
 dist/bind/lib/irs/lcl_pw.c                     |     2 +-
 dist/bind/lib/irs/lcl_sv.c                     |     2 +-
 dist/bind/lib/irs/nis.c                        |     6 +-
 dist/bind/lib/irs/nis_gr.c                     |     2 +-
 dist/bind/lib/irs/nis_ho.c                     |     2 +-
 dist/bind/lib/irs/nis_ng.c                     |     2 +-
 dist/bind/lib/irs/nis_nw.c                     |     2 +-
 dist/bind/lib/irs/nis_pr.c                     |     2 +-
 dist/bind/lib/irs/nis_pw.c                     |     2 +-
 dist/bind/lib/irs/nis_sv.c                     |     2 +-
 dist/bind/lib/irs/nul_ng.c                     |     2 +-
 dist/bind/lib/irs/util.c                       |     6 +-
 dist/bind/lib/isc/assertions.c                 |     2 +-
 dist/bind/lib/isc/bitncmp.c                    |     2 +-
 dist/bind/lib/isc/ctl_clnt.c                   |    41 +-
 dist/bind/lib/isc/ctl_p.c                      |    42 +-
 dist/bind/lib/isc/ctl_p.h                      |     2 +-
 dist/bind/lib/isc/ctl_srvr.c                   |    70 +-
 dist/bind/lib/isc/ev_connects.c                |    29 +-
 dist/bind/lib/isc/ev_files.c                   |    23 +-
 dist/bind/lib/isc/ev_streams.c                 |     2 +-
 dist/bind/lib/isc/ev_timers.c                  |    17 +-
 dist/bind/lib/isc/eventlib.c                   |    12 +-
 dist/bind/lib/isc/eventlib_p.h                 |    12 +-
 dist/bind/lib/isc/logging.c                    |    28 +-
 dist/bind/lib/isc/memcluster.c                 |    37 +-
 dist/bind/lib/isc/tree.c                       |     2 +-
 dist/bind/lib/nameser/ns_date.c                |     2 +-
 dist/bind/lib/nameser/ns_name.c                |   325 ++++++-
 dist/bind/lib/nameser/ns_parse.c               |    34 +-
 dist/bind/lib/nameser/ns_print.c               |    54 +-
 dist/bind/lib/nameser/ns_sign.c                |    36 +-
 dist/bind/lib/nameser/ns_verify.c              |     9 +-
 dist/bind/lib/resolv/herror.c                  |     2 +-
 dist/bind/lib/resolv/res_debug.c               |   221 +++-
 dist/bind/lib/resolv/res_findzonecut.c         |   171 ++-
 dist/bind/lib/resolv/res_init.c                |   251 ++++-
 dist/bind/lib/resolv/res_mkquery.c             |     2 +-
 dist/bind/lib/resolv/res_mkupdate.c            |    12 +-
 dist/bind/lib/resolv/res_query.c               |    40 +-
 dist/bind/lib/resolv/res_send.c                |   287 ++++-
 dist/bind/lib/resolv/res_update.c              |    69 +-
 dist/bind/man/dig.1                            |    45 +-
 dist/bind/man/dnskeygen.1                      |    32 +-
 dist/bind/man/dnsquery.1                       |    36 +-
 dist/bind/man/host.1                           |    15 +-
 dist/bind/man/named-bootconf.8                 |     3 +-
 dist/bind/man/named-xfer.8                     |     8 +-
 dist/bind/man/named.8                          |    29 +-
 dist/bind/man/named.conf.5                     |   542 +++-------
 dist/bind/man/ndc.8                            |     4 +-
 dist/bind/man/nslookup.8                       |   101 +-
 dist/bind/man/nsupdate.8                       |    38 +-
 usr.sbin/bind/lib/Makefile                     |     4 +-
 193 files changed, 8685 insertions(+), 4147 deletions(-)

diffs (truncated from 27955 to 300 lines):

diff -r db90775707b5 -r 361f5ba67f37 dist/bind/README
--- a/dist/bind/README  Thu Jun 20 10:44:07 2002 +0000
+++ b/dist/bind/README  Thu Jun 20 11:42:53 2002 +0000
@@ -10,9 +10,26 @@
 Note that BIND 8 is in "end-of-life", having been replaced by BIND 9.  See
 http://www.isc.org/ for more details.
 
+BIND 8.3.2 Highlights
+       dig, nslookup, host and nsupdate have improved IPv6 support.
+
+BIND 8.3.1 Highlights
+       Critical bug fix to prevent DNS storms. If you have BIND 8.3.0 you
+       need to upgrade.
+
+BIND 8.3.0 Highlights
+       IPv6 transport support in resolver (from KAME).
+       Opaque rdata support.
+       EDNS0 support.
+       Glue ordering to help non-ENDS0 aware clients (servers) cope with
+       larger responses as a result of IPv6 by allowing A records to be added
+       first to the additional section.  IPv6 capable clients are expected to
+       use EDNS0 to allow larger responses to be sent.
+       Bug Fixes, includes BIND 8.2.5 changes.
+
 BIND 8.2.4 Highlights
        NSAP processing was not RFC 1706 compliant. NOTE: OLD MASTER FILES
-       NEED TO BE CORRECTED (0x added to NSAP) AND CACHE FILES REMOVED.
+       NEED TO BE CORRECTED AND CACHE FILES REMOVED.
        Fixes long-standing protocol incompatibility in DNSSEC support.
        Avoids fwd'ing to root name servers if response will be rejected.
        new port/cygwin contributed by s_c_biggs%bigfoot.com@localhost.
diff -r db90775707b5 -r 361f5ba67f37 dist/bind/bin/addr/addr.c
--- a/dist/bind/bin/addr/addr.c Thu Jun 20 10:44:07 2002 +0000
+++ b/dist/bind/bin/addr/addr.c Thu Jun 20 11:42:53 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: addr.c,v 1.1.1.2 2002/06/20 10:29:24 itojun Exp $      */
+/*     $NetBSD: addr.c,v 1.2 2002/06/20 11:42:54 itojun Exp $  */
 
 #if !defined(lint) && !defined(SABER)
 static const char rcsid[] = "Id: addr.c,v 8.9 2002/05/21 02:26:21 marka Exp";
diff -r db90775707b5 -r 361f5ba67f37 dist/bind/bin/dig/dig.c
--- a/dist/bind/bin/dig/dig.c   Thu Jun 20 10:44:07 2002 +0000
+++ b/dist/bind/bin/dig/dig.c   Thu Jun 20 11:42:53 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: dig.c,v 1.4 2001/05/17 22:59:38 itojun Exp $   */
+/*     $NetBSD: dig.c,v 1.5 2002/06/20 11:42:54 itojun Exp $   */
 
 #ifndef lint
-static const char rcsid[] = "Id: dig.c,v 8.46 2001/04/01 17:35:01 vixie Exp";
+static const char rcsid[] = "Id: dig.c,v 8.57 2002/06/18 02:26:49 marka Exp";
 #endif
 
 /*
@@ -174,7 +174,6 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <netdb.h>
-#include <resolv.h>
 #include <setjmp.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -183,6 +182,8 @@
 
 #include "port_after.h"
 
+#include <resolv.h>
+
 #include "../nslookup/res.h"
 
 /* Global. */
@@ -190,9 +191,15 @@
 #define VERSION 83
 #define VSTRING "8.3"
 
-#define PRF_DEF                0x2ff9
-#define PRF_MIN                0xA930
-#define PRF_ZONE        0x24f9
+#define PRF_DEF                (RES_PRF_STATS | RES_PRF_CMD | RES_PRF_QUES | \
+                        RES_PRF_ANS | RES_PRF_AUTH | RES_PRF_ADD | \
+                        RES_PRF_HEAD1 | RES_PRF_HEAD2 | RES_PRF_TTLID | \
+                        RES_PRF_HEADX | RES_PRF_REPLY | RES_PRF_TRUNC)
+#define PRF_MIN                (RES_PRF_QUES | RES_PRF_ANS | RES_PRF_HEAD1 | \
+                        RES_PRF_HEADX | RES_PRF_REPLY | RES_PRF_TRUNC)
+#define PRF_ZONE        (RES_PRF_STATS | RES_PRF_CMD | RES_PRF_QUES | \
+                        RES_PRF_ANS | RES_PRF_AUTH | RES_PRF_ADD | \
+                        RES_PRF_TTLID | RES_PRF_REPLY | RES_PRF_TRUNC)
 
 #ifndef MAXHOSTNAMELEN
 #define MAXHOSTNAMELEN 256
@@ -205,9 +212,10 @@
 static FILE *          qfp;
 static char            *defsrv, *srvmsg;
 static char            defbuf[40] = "default -- ";
-static char            srvbuf[60];
+static char            srvbuf[1024];
 static char            myhostname[MAXHOSTNAMELEN];
 static struct sockaddr_in myaddress;
+static struct sockaddr_in6 myaddress6;
 static u_int32_t       ixfr_serial;
 
 /* stuff for nslookup modules */
@@ -221,7 +229,7 @@
 extern int     StringToClass(), StringToType();        /* subr.c */
 #if defined(BSD) && BSD >= 199006 && !defined(RISCOS_BSD)
 FILE           *yyin = NULL;
-void           yyrestart(FILE *f) { }
+void           yyrestart(FILE *f) { UNUSED(f); }
 #endif
 char           *pager = NULL;
 /* end of nslookup stuff */
@@ -239,13 +247,14 @@
 static struct timeval  difftv(struct timeval, struct timeval);
 static void            prnttime(struct timeval);
 static void            stackarg(char *, char **);
+static void            reverse6(char *, struct in6_addr *);
 
 /* Public. */
 
 int
 main(int argc, char **argv) {
-       struct hostent *hp;
        short port = htons(NAMESERVER_PORT);
+       short lport;
        /* Wierd stuff for SPARC alignment, hurts nothing else. */
        union {
                HEADER header_;
@@ -283,6 +292,8 @@
        int wait=0, delay;
        int envset=0, envsave=0;
        struct __res_state res_x, res_t;
+       int r;
+       struct in6_addr in6;
 
        ns_tsig_key key;
        char *keyfile = NULL, *keyname = NULL;
@@ -298,6 +309,14 @@
        myaddress.sin_family = AF_INET;
        myaddress.sin_addr.s_addr = INADDR_ANY;
        myaddress.sin_port = 0; /*INPORT_ANY*/;
+
+#ifdef HAVE_SA_LEN
+       myaddress6.sin6_len = sizeof(struct sockaddr_in6);
+#endif
+       myaddress6.sin6_family = AF_INET6;
+       myaddress6.sin6_addr = in6addr_any;
+       myaddress6.sin6_port = 0; /*INPORT_ANY*/;
+
        defsrv = strcat(defbuf, inet_ntoa(res.nsaddr.sin_addr));
        res_x = res;
 
@@ -450,13 +469,21 @@
                                                printf("; no arg for -t?\n");
                                        else if ((tmp = atoi(*argv))
                                            || *argv[0]=='0') {
-                                               queryType = tmp;
-                                               qtypeSet++;
+                                               if (ns_t_xfr_p(tmp)) {
+                                                       xfr = tmp;
+                                               } else {
+                                                       queryType = tmp;
+                                                       qtypeSet++;
+                                               }
                                        } else if ((tmp = StringToType(*argv,
                                                                      0, NULL)
                                                   ) != 0) {
-                                               queryType = tmp;
-                                               qtypeSet++;
+                                               if (ns_t_xfr_p(tmp)) {
+                                                       xfr = tmp;
+                                               } else {
+                                                       queryType = tmp;
+                                                       qtypeSet++;
+                                               }
                                        } else {
                                                printf(
                                                   "; invalid type specified\n"
@@ -472,6 +499,11 @@
                                                printf("; no arg for -x?\n");
                                                break;
                                        }
+                                       r = inet_pton(AF_INET6, addrc, &in6);
+                                       if (r > 0) {
+                                               reverse6(domain, &in6);
+                                               break;
+                                       }
                                        addrend = addrc + strlen(addrc);
                                        if (*addrend == '.')
                                                *addrend = '\0';
@@ -486,7 +518,7 @@
                                        break;
                                case 'p':
                                        if (argv[0][2] != '\0')
-                                               port = ntohs(atoi(argv[0]+2));
+                                               port = htons(atoi(argv[0]+2));
                                        else if (*++argv == NULL)
                                                printf("; no arg for -p?\n");
                                        else
@@ -518,14 +550,19 @@
                                                a = *argv;
                                        if ((p = strchr(a, ':')) != NULL) {
                                                *p++ = '\0';
-                                               myaddress.sin_port =
-                                                       ntohs(atoi(p));
-                                       }
-                                       if (!inet_aton(a,&myaddress.sin_addr)){
+                                               lport = htons(atoi(p));
+                                       } else
+                                               lport = htons(0);
+                                       if (inet_pton(AF_INET6, a,
+                                             &myaddress6.sin6_addr) == 1) {
+                                             myaddress6.sin6_port = lport;
+                                       } else if (!inet_aton(a,
+                                                  &myaddress.sin_addr)) {
                                                fprintf(stderr,
                                                        ";; bad -b addr\n");
                                                exit(1);
-                                       }
+                                       } else
+                                               myaddress.sin_port = lport;
                                    }
                                    break;
                                case 'k':
@@ -737,82 +774,113 @@
                srvbuf[0] = 0;
                srvmsg = defsrv;
                if (srv != NULL) {
-                       struct in_addr addr;
+                       int nscount = 0;
+                       union res_sockaddr_union u[MAXNS];
+                       struct addrinfo *answer = NULL;
+                       struct addrinfo *cur = NULL;
+                       struct addrinfo hint;
 
-                       if (inet_aton(srv, &addr)) {
-                               res.nscount = 1;
-                               res.nsaddr.sin_addr = addr;
-                               srvmsg = strcat(srvbuf, srv);
+                       memset(u, 0, sizeof(u));
+                       res_t = res;
+                       res_ninit(&res);
+                       res.pfcode = 0;
+                       res.options = RES_DEFAULT;
+                       memset(&hint, 0, sizeof(hint));
+                       hint.ai_socktype = SOCK_DGRAM;
+                       if (!getaddrinfo(srv, NULL, &hint, &answer)) {
+                               res = res_t;
+                               cur = answer;
+                               for (cur = answer;
+                                    cur != NULL;
+                                    cur = cur->ai_next) {
+                                       if (nscount == MAXNS)
+                                               break;
+                                       switch (cur->ai_addr->sa_family) {
+                                       case AF_INET6:
+                                               u[nscount].sin6 =
+                                         *(struct sockaddr_in6*)cur->ai_addr;
+                                               u[nscount++].sin6.sin6_port =
+                                                       port;
+                                               break;
+                                       case AF_INET:
+                                               u[nscount].sin =
+                                          *(struct sockaddr_in*)cur->ai_addr;
+                                               u[nscount++].sin6.sin6_port =
+                                                       port;
+                                               break;
+                                       }
+                               }
+                               if (nscount != 0) {
+                                       char buf[80];
+                                       res_setservers(&res, u, nscount);
+                                       srvmsg = strcat(srvbuf, srv);
+                                       strcat(srvbuf, "  ");
+                                       buf[0] = '\0';
+                                       switch (u[0].sin.sin_family) {
+                                       case AF_INET:
+                                               inet_ntop(AF_INET,
+                                                         &u[0].sin.sin_addr,
+                                                         buf, sizeof(buf));
+                                               break;
+                                       case AF_INET6:
+                                               inet_ntop(AF_INET6,
+                                                         &u[0].sin6.sin6_addr,
+                                                         buf, sizeof(buf));
+                                               break;
+                                       }
+                                       strcat(srvbuf, buf);
+                               }
+                               freeaddrinfo(answer);
                        } else {
-                               res_t = res;
-                               res_ninit(&res);
-                               res.pfcode = 0;
-                               res.options = RES_DEFAULT;
-                               hp = gethostbyname(srv);
                                res = res_t;
-                               if (hp == NULL
-                                   || hp->h_addr_list == NULL
-                                   || *hp->h_addr_list == NULL) {
-                                       fflush(stdout);
-                                       fprintf(stderr,



Home | Main Index | Thread Index | Old Index