diff options
author | asmodai <asmodai@FreeBSD.org> | 2001-01-28 23:00:22 +0000 |
---|---|---|
committer | asmodai <asmodai@FreeBSD.org> | 2001-01-28 23:00:22 +0000 |
commit | 1f243835b5b81bfd6b9e5f666730965fe5d60ed6 (patch) | |
tree | 4c0925b2692b57db0c0c1044db977bbc4c0899d7 /contrib/bind/lib/irs | |
parent | 43c4a8b07e19a2567390a7f788929e5c908a4d7b (diff) | |
download | FreeBSD-src-1f243835b5b81bfd6b9e5f666730965fe5d60ed6.zip FreeBSD-src-1f243835b5b81bfd6b9e5f666730965fe5d60ed6.tar.gz |
Virgin import of BIND v8.2.3-REL
Diffstat (limited to 'contrib/bind/lib/irs')
-rw-r--r-- | contrib/bind/lib/irs/Makefile | 6 | ||||
-rw-r--r-- | contrib/bind/lib/irs/getnameinfo.c | 10 | ||||
-rw-r--r-- | contrib/bind/lib/irs/getnetent.c | 10 | ||||
-rw-r--r-- | contrib/bind/lib/irs/irpmarshall.c | 7 | ||||
-rw-r--r-- | contrib/bind/lib/irs/irs_data.c | 5 |
5 files changed, 22 insertions, 16 deletions
diff --git a/contrib/bind/lib/irs/Makefile b/contrib/bind/lib/irs/Makefile index a17f252..4784ccf 100644 --- a/contrib/bind/lib/irs/Makefile +++ b/contrib/bind/lib/irs/Makefile @@ -13,12 +13,12 @@ # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS # SOFTWARE. -# $Id: Makefile,v 8.20 2000/07/11 06:41:40 vixie Exp $ +# $Id: Makefile,v 8.21 2000/12/23 08:02:59 vixie Exp $ # these are only appropriate for BSD 4.4 or derivatives, and are used in # development. normal builds will be done in the top level directory and # this Makefile will be invoked with a lot of overrides for the following: -SYSTYPE= bsdos +SYSTYPE= freebsd DESTDIR = DESTLIB = /usr/local/lib O=o @@ -26,7 +26,7 @@ A=a CC= cc LD= ld SHELL= /bin/sh -CDEBUG= -g +CDEBUG= -g -Wall TOP= ../.. INCL = ${TOP}/include PORTINCL = ${TOP}/port/${SYSTYPE}/include diff --git a/contrib/bind/lib/irs/getnameinfo.c b/contrib/bind/lib/irs/getnameinfo.c index 7bd30ae..9f186f3 100644 --- a/contrib/bind/lib/irs/getnameinfo.c +++ b/contrib/bind/lib/irs/getnameinfo.c @@ -165,14 +165,14 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) if (serv == NULL || servlen == 0) { /* what we should do? */ } else if (flags & NI_NUMERICSERV) { - snprintf(numserv, strlen(numserv), "%d", ntohs(port)); + snprintf(numserv, sizeof(numserv), "%d", ntohs(port)); if (strlen(numserv) > servlen) return ENI_MEMORY; strcpy(serv, numserv); } else { sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp"); if (sp) { - if (strlen(sp->s_name) > servlen) + if (strlen(sp->s_name) + 1 > servlen) return ENI_MEMORY; strcpy(serv, sp->s_name); } else @@ -196,7 +196,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) if (inet_ntop(afd->a_af, addr, numaddr, sizeof(numaddr)) == NULL) return ENI_SYSTEM; - if (strlen(numaddr) > hostlen) + if (strlen(numaddr) + 1 > hostlen) return ENI_MEMORY; strcpy(host, numaddr); } else { @@ -207,7 +207,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) p = strchr(hp->h_name, '.'); if (p) *p = '\0'; } - if (strlen(hp->h_name) > hostlen) + if (strlen(hp->h_name) + 1 > hostlen) return ENI_MEMORY; strcpy(host, hp->h_name); } else { @@ -216,7 +216,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) if (inet_ntop(afd->a_af, addr, numaddr, sizeof(numaddr)) == NULL) return ENI_NOHOSTNAME; - if (strlen(numaddr) > hostlen) + if (strlen(numaddr) + 1 > hostlen) return ENI_MEMORY; strcpy(host, numaddr); } diff --git a/contrib/bind/lib/irs/getnetent.c b/contrib/bind/lib/irs/getnetent.c index b63ddaf..52aebe3 100644 --- a/contrib/bind/lib/irs/getnetent.c +++ b/contrib/bind/lib/irs/getnetent.c @@ -16,7 +16,7 @@ */ #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$Id: getnetent.c,v 1.17 1999/10/13 16:39:30 vixie Exp $"; +static const char rcsid[] = "$Id: getnetent.c,v 1.18 2000/12/23 08:14:53 vixie Exp $"; #endif /* Imports */ @@ -175,14 +175,16 @@ getnetbyaddr_p(unsigned long net, int type, struct net_data *net_data) { addr[3] = (0x000000FF & net); /* reduce bits to as close to natural number as possible */ - if ((bits == 32) && (addr[0] < 224) && (addr[3] == 0)) - if ((addr[0] < 192) && (addr[2] == 0)) + if ((bits == 32) && (addr[0] < 224) && (addr[3] == 0)) { + if ((addr[0] < 192) && (addr[2] == 0)) { if ((addr[0] < 128) && (addr[1] == 0)) bits = 8; else bits = 16; - else + } else { bits = 24; + } + } net_data->nww_last = (*nw->byaddr)(nw, addr, bits, AF_INET); net_data->nw_last = nw_to_net(net_data->nww_last, net_data); diff --git a/contrib/bind/lib/irs/irpmarshall.c b/contrib/bind/lib/irs/irpmarshall.c index 8f7c330..240bb08 100644 --- a/contrib/bind/lib/irs/irpmarshall.c +++ b/contrib/bind/lib/irs/irpmarshall.c @@ -49,7 +49,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: irpmarshall.c,v 8.5 1999/10/13 17:11:19 vixie Exp $"; +static const char rcsid[] = "$Id: irpmarshall.c,v 8.6 2000/11/13 05:08:08 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ #if 0 @@ -90,7 +90,10 @@ Double check memory allocations on unmarhsalling #include "port_after.h" +#ifndef HAVE_STRNDUP static char *strndup(const char *str, size_t len); +#endif + static char **splitarray(const char *buffer, const char *buffend, char delim); static int joinarray(char * const * argv, char *buffer, char delim); static char *getfield(char **res, size_t reslen, char **buffer, char delim); @@ -1862,6 +1865,7 @@ getfield(char **res, size_t reslen, char **ptr, char delim) { +#ifndef HAVE_STRNDUP /* * static char * strndup(const char *str, size_t len) * @@ -1886,6 +1890,7 @@ strndup(const char *str, size_t len) { p[len] = 0x0; return (p); } +#endif #if WANT_MAIN diff --git a/contrib/bind/lib/irs/irs_data.c b/contrib/bind/lib/irs/irs_data.c index f31fe69..8446c6b 100644 --- a/contrib/bind/lib/irs/irs_data.c +++ b/contrib/bind/lib/irs/irs_data.c @@ -16,7 +16,7 @@ */ #if !defined(LINT) && !defined(CODECENTER) -static const char rcsid[] = "$Id: irs_data.c,v 1.14 1999/10/13 16:39:31 vixie Exp $"; +static const char rcsid[] = "$Id: irs_data.c,v 1.15 2000/12/23 08:14:54 vixie Exp $"; #endif #include "port_before.h" @@ -55,7 +55,7 @@ static struct net_data *net_data; #endif void -irs_destroy() { +irs_destroy(void) { #ifndef DO_PTHREADS if (net_data != NULL) net_data_destroy(net_data); @@ -67,7 +67,6 @@ void net_data_destroy(void *p) { struct net_data *net_data = p; - res_nclose(net_data->res); if (net_data->gr != NULL) { (*net_data->gr->close)(net_data->gr); |