From 1f243835b5b81bfd6b9e5f666730965fe5d60ed6 Mon Sep 17 00:00:00 2001 From: asmodai Date: Sun, 28 Jan 2001 23:00:22 +0000 Subject: Virgin import of BIND v8.2.3-REL --- contrib/bind/lib/inet/Makefile | 6 +++--- contrib/bind/lib/inet/inet_cidr_pton.c | 5 +++-- contrib/bind/lib/inet/inet_net_ntop.c | 8 ++++---- contrib/bind/lib/inet/inet_ntop.c | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) (limited to 'contrib/bind/lib/inet') diff --git a/contrib/bind/lib/inet/Makefile b/contrib/bind/lib/inet/Makefile index 2be32bd..1876bb6 100644 --- a/contrib/bind/lib/inet/Makefile +++ b/contrib/bind/lib/inet/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/inet/inet_cidr_pton.c b/contrib/bind/lib/inet/inet_cidr_pton.c index 4fae2c6..9ead90b 100644 --- a/contrib/bind/lib/inet/inet_cidr_pton.c +++ b/contrib/bind/lib/inet/inet_cidr_pton.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_cidr_pton.c,v 8.3 1999/01/08 19:23:41 vixie Exp $"; +static const char rcsid[] = "$Id: inet_cidr_pton.c,v 8.4 2000/12/23 08:14:53 vixie Exp $"; #endif #include "port_before.h" @@ -122,11 +122,12 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, int *pbits) { goto enoent; /* Prefix length can default to /32 only if all four octets spec'd. */ - if (bits == -1) + if (bits == -1) { if (dst - odst == 4) bits = 32; else goto enoent; + } /* If nothing was written to the destination, we found no address. */ if (dst == odst) diff --git a/contrib/bind/lib/inet/inet_net_ntop.c b/contrib/bind/lib/inet/inet_net_ntop.c index 4e2f91f..d8b8377 100644 --- a/contrib/bind/lib/inet/inet_net_ntop.c +++ b/contrib/bind/lib/inet/inet_net_ntop.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.6 1999/01/08 19:23:42 vixie Exp $"; +static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.7 2001/01/25 19:55:59 vixie Exp $"; #endif #include "port_before.h" @@ -108,7 +108,7 @@ inet_net_ntop_ipv4(src, bits, dst, size) /* Format whole octets. */ for (b = bits / 8; b > 0; b--) { - if (size < sizeof "255.") + if (size <= sizeof "255.") goto emsgsize; t = dst; dst += SPRINTF((dst, "%u", *src++)); @@ -122,7 +122,7 @@ inet_net_ntop_ipv4(src, bits, dst, size) /* Format partial octet. */ b = bits % 8; if (b > 0) { - if (size < sizeof ".255") + if (size <= sizeof ".255") goto emsgsize; t = dst; if (dst != odst) @@ -133,7 +133,7 @@ inet_net_ntop_ipv4(src, bits, dst, size) } /* Format CIDR /width. */ - if (size < sizeof "/32") + if (size <= sizeof "/32") goto emsgsize; dst += SPRINTF((dst, "/%u", bits)); return (odst); diff --git a/contrib/bind/lib/inet/inet_ntop.c b/contrib/bind/lib/inet/inet_ntop.c index 0b85e70..d588e9f 100644 --- a/contrib/bind/lib/inet/inet_ntop.c +++ b/contrib/bind/lib/inet/inet_ntop.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_ntop.c,v 1.8 1999/10/13 16:39:28 vixie Exp $"; +static const char rcsid[] = "$Id: inet_ntop.c,v 1.10 2001/01/25 20:21:10 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -96,7 +96,7 @@ inet_ntop4(src, dst, size) static const char fmt[] = "%u.%u.%u.%u"; char tmp[sizeof "255.255.255.255"]; - if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) { + if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) >= size) { errno = ENOSPC; return (NULL); } -- cgit v1.1