Source-Changes-HG archive

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

[src/netbsd-1-6]: src/dist/bind/include Pull up revision 1.7 (requested by it...



details:   https://anonhg.NetBSD.org/src/rev/f9977d3ca79b
branches:  netbsd-1-6
changeset: 528177:f9977d3ca79b
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Jun 28 11:40:20 2002 +0000

description:
Pull up revision 1.7 (requested by itojun in ticket #387):
Update to BIND 8.3.3.  Fixes buffer overrun in resolver code.

diffstat:

 dist/bind/include/resolv.h |  95 ++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 84 insertions(+), 11 deletions(-)

diffs (224 lines):

diff -r 9402fa728c7d -r f9977d3ca79b dist/bind/include/resolv.h
--- a/dist/bind/include/resolv.h        Fri Jun 28 11:40:11 2002 +0000
+++ b/dist/bind/include/resolv.h        Fri Jun 28 11:40:20 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: resolv.h,v 1.6 2001/05/17 22:59:42 itojun Exp $        */
+/*     $NetBSD: resolv.h,v 1.6.2.1 2002/06/28 11:40:20 lukem Exp $     */
 
 /*
  * Copyright (c) 1983, 1987, 1989
@@ -52,7 +52,7 @@
 
 /*
  *     @(#)resolv.h    8.1 (Berkeley) 6/2/93
- *     Id: resolv.h,v 8.32.2.1 2001/05/17 03:01:30 marka Exp
+ *     Id: resolv.h,v 8.48 2002/05/31 06:05:29 marka Exp
  */
 
 #ifndef _RESOLV_H_
@@ -65,7 +65,9 @@
 # include <sys/types.h>
 #endif
 #include <sys/cdefs.h>
+#include <sys/socket.h>
 #include <stdio.h>
+#include <arpa/nameser.h>
 
 /*
  * Revision information.  This is the release date in YYYYMMDD format.
@@ -188,14 +190,14 @@
 typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
        res_sendhookact;
 
-typedef res_sendhookact (*res_send_qhook)__P((struct sockaddr_in * const *ns,
+typedef res_sendhookact (*res_send_qhook)__P((struct sockaddr * const *ns,
                                              const u_char **query,
                                              int *querylen,
                                              u_char *ans,
                                              int anssiz,
                                              int *resplen));
 
-typedef res_sendhookact (*res_send_rhook)__P((const struct sockaddr_in *ns,
+typedef res_sendhookact (*res_send_rhook)__P((const struct sockaddr *ns,
                                              const u_char *query,
                                              int querylen,
                                              u_char *ans,
@@ -203,9 +205,9 @@
                                              int *resplen));
 
 struct res_sym {
-       int     number;         /* Identifying number, like T_MX */
-       char *  name;           /* Its symbolic name, like "MX" */
-       char *  humanname;      /* Its fun name, like "mail exchanger" */
+       int             number;    /* Identifying number, like T_MX */
+       const char *    name;      /* Its symbolic name, like "MX" */
+       const char *    humanname; /* Its fun name, like "mail exchanger" */
 };
 
 /*
@@ -224,10 +226,16 @@
 #define        RES_DFLRETRY            2       /* Default #/tries. */
 #define        RES_MAXTIME             65535   /* Infinity, in milliseconds. */
 
+struct __res_state_ext;
+
 struct __res_state {
        int     retrans;                /* retransmition time interval */
        int     retry;                  /* number of times to retransmit */
+#ifdef sun
+       u_int   options;                /* option flags - see below. */
+#else
        u_long  options;                /* option flags - see below. */
+#endif
        int     nscount;                /* number of name servers */
        struct sockaddr_in
                nsaddr_list[MAXNS];     /* address of name server */
@@ -235,7 +243,11 @@
        u_short id;                     /* current message id */
        char    *dnsrch[MAXDNSRCH+1];   /* components of domain to search */
        char    defdname[256];          /* default domain (deprecated) */
+#ifdef sun
+       u_int   pfcode;                 /* RES_PRF_ flags - see below. */
+#else
        u_long  pfcode;                 /* RES_PRF_ flags - see below. */
+#endif
        unsigned ndots:4;               /* threshold for initial abs. query */
        unsigned nsort:4;               /* number of elements in sort_list[] */
        char    unused[3];
@@ -248,27 +260,45 @@
        int     res_h_errno;            /* last one set for this context */
        int     _vcsock;                /* PRIVATE: for res_send VC i/o */
        u_int   _flags;                 /* PRIVATE: see below */
+       u_int   _pad;                   /* make _u 64 bit aligned */
        union {
-               char    pad[52];        /* On an i386 this means 512b total. */
+               /* On an 32-bit arch this means 512b total. */
+               char    pad[72 - 4*sizeof (int) - 2*sizeof (void *)];
                struct {
                        u_int16_t               nscount;
                        u_int16_t               nstimes[MAXNS]; /* ms. */
                        int                     nssocks[MAXNS];
-                       struct sockaddr_in      nsaddrs[MAXNS];
+                       struct __res_state_ext *ext;    /* extention for IPv6 */
                } _ext;
        } _u;
 };
 
 typedef struct __res_state *res_state;
 
+union res_sockaddr_union {
+       struct sockaddr_in      sin;
+#ifdef IN6ADDR_ANY_INIT
+       struct sockaddr_in6     sin6;
+#endif
+#ifdef ISC_ALIGN64
+       int64_t                 __align64;      /* 64bit alignment */
+#else
+       int32_t                 __align32;      /* 32bit alignment */
+#endif
+       char                    __space[128];   /* max size */
+};
+
 /*
  * Resolver flags (used to be discrete per-module statics ints).
  */
 #define        RES_F_VC        0x00000001      /* socket is TCP */
 #define        RES_F_CONN      0x00000002      /* socket is connected */
+#define        RES_F_EDNS0ERR  0x00000004      /* EDNS0 caused errors */
 
-/* res_findzonecut() options */
+/* res_findzonecut2() options */
 #define        RES_EXHAUSTIVE  0x00000001      /* always do all queries */
+#define        RES_IPV4ONLY    0x00000002      /* IPv4 only */
+#define        RES_IPV6ONLY    0x00000004      /* IPv6 only */
 
 /*
  * Resolver options (keep these in synch with res_debug.c, please)
@@ -291,6 +321,15 @@
 #define        RES_NOCHECKNAME 0x00008000      /* do not check names for sanity. */
 #define        RES_KEEPTSIG    0x00010000      /* do not strip TSIG records */
 #define        RES_BLAST       0x00020000      /* blast all recursive servers */
+#define RES_NO_NIBBLE  0x00040000      /* disable IPv6 nibble mode reverse */
+#define RES_NO_BITSTRING 0x00080000    /* disable IPv6 bitstring mode reverse */
+#define RES_NOTLDQUERY 0x00100000      /* don't unqualified name as a tld */
+#define RES_USE_DNSSEC 0x00200000      /* use DNSSEC using OK bit in OPT */
+/* KAME extensions: use higher bit to avoid conflict with ISC use */
+#define RES_USE_DNAME  0x10000000      /* use DNAME */
+#define RES_USE_A6     0x20000000      /* use A6 */
+#define RES_USE_EDNS0  0x40000000      /* use EDNS0 if configured */
+#define RES_NO_NIBBLE2 0x80000000      /* disable alternate nibble lookup */
 
 #define RES_DEFAULT    (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
 
@@ -312,7 +351,8 @@
 #define RES_PRF_QUERY  0x00001000
 #define RES_PRF_REPLY  0x00002000
 #define RES_PRF_INIT   0x00004000
-/*                     0x00008000      */
+#define RES_PRF_TRUNC  0x00008000
+/*                     0x00010000      */
 
 /* Things involving an internal (static) resolver context. */
 #ifdef _REENTRANT
@@ -400,6 +440,7 @@
 #define putshort               __putshort
 #define res_dnok               __res_dnok
 #define res_findzonecut                __res_findzonecut
+#define res_findzonecut2       __res_findzonecut2
 #define res_hnok               __res_hnok
 #define res_hostalias          __res_hostalias
 #define res_mailok             __res_mailok
@@ -420,6 +461,12 @@
 #define sym_ntop               __sym_ntop
 #define sym_ntos               __sym_ntos
 #define sym_ston               __sym_ston
+#define res_nopt               __res_nopt
+#define res_ndestroy           __res_ndestroy
+#define        res_nametoclass         __res_nametoclass
+#define        res_nametotype          __res_nametotype
+#define        res_setservers          __res_setservers
+#define        res_getservers          __res_getservers
 __BEGIN_DECLS
 int            res_hnok __P((const char *));
 int            res_ownok __P((const char *));
@@ -435,6 +482,10 @@
 int            dn_skipname __P((const u_char *, const u_char *));
 void           putlong __P((u_int32_t, u_char *));
 void           putshort __P((u_int16_t, u_char *));
+#ifndef __ultrix__
+u_int16_t      _getshort __P((const u_char *src));
+u_int32_t      _getlong __P((const u_char *src));
+#endif
 const char *   p_class __P((int));
 const char *   p_time __P((u_int32_t));
 const char *   p_type __P((int));
@@ -480,7 +531,29 @@
                                     ns_tsig_key *, u_char *, int));
 int            res_findzonecut __P((res_state, const char *, ns_class, int,
                                     char *, size_t, struct in_addr *, int));
+int            res_findzonecut2 __P((res_state, const char *, ns_class, int,
+                                     char *, size_t,
+                                     union res_sockaddr_union *, int));
 void           res_nclose __P((res_state));
+int            res_nopt __P((res_state, int, u_char *, int, int));
+void           res_send_setqhook __P((res_send_qhook hook));
+void           res_send_setrhook __P((res_send_rhook hook));
+int            __res_vinit __P((res_state, int));
+void           res_destroyservicelist __P((void));
+const char *   res_servicename __P((u_int16_t port, const char *proto));
+const char *   res_protocolname __P((int num));
+void           res_destroyprotolist __P((void));
+void           res_buildprotolist __P((void));
+const char *   res_get_nibblesuffix __P((res_state));
+const char *   res_get_nibblesuffix2 __P((res_state));
+const char *   res_get_bitstringsuffix __P((res_state));
+void           res_ndestroy __P((res_state));
+u_int16_t      res_nametoclass __P((const char *buf, int *success));
+u_int16_t      res_nametotype __P((const char *buf, int *success));
+void           res_setservers __P((res_state,
+                                   const union res_sockaddr_union *, int));
+int            res_getservers __P((res_state,
+                                   union res_sockaddr_union *, int));
 __END_DECLS
 
 #endif /* !_RESOLV_H_ */



Home | Main Index | Thread Index | Old Index