summaryrefslogtreecommitdiffstats
path: root/lib/libc/inet/inet_cidr_pton.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2007-06-03 17:20:27 +0000
committerume <ume@FreeBSD.org>2007-06-03 17:20:27 +0000
commit1f0b78cb3e02e3e161fed2e61d1cf1d0fb386365 (patch)
tree4c177bc1c465cdceae9dd1ea93c01fa64b220b93 /lib/libc/inet/inet_cidr_pton.c
parent09efba1c33e3e58c865d7f628c4f48e47d74bcd0 (diff)
downloadFreeBSD-src-1f0b78cb3e02e3e161fed2e61d1cf1d0fb386365.zip
FreeBSD-src-1f0b78cb3e02e3e161fed2e61d1cf1d0fb386365.tar.gz
Merge BIND 9.4.1 into main chunk.
MFC after: 2 weeks
Diffstat (limited to 'lib/libc/inet/inet_cidr_pton.c')
-rw-r--r--lib/libc/inet/inet_cidr_pton.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/libc/inet/inet_cidr_pton.c b/lib/libc/inet/inet_cidr_pton.c
index 3089eb9..b0586ff 100644
--- a/lib/libc/inet/inet_cidr_pton.c
+++ b/lib/libc/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 1.2.2.1.8.2 2004/03/17 00:29:46 marka Exp $";
+static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.5.18.1 2005/04/27 05:00:53 sra Exp $";
#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -51,7 +51,7 @@ static int inet_cidr_pton_ipv6 __P((const char *src, u_char *dst,
static int getbits(const char *, int ipv6);
-/*
+/*%
* int
* inet_cidr_pton(af, src, dst, *bits)
* convert network address from presentation to network format.
@@ -206,7 +206,7 @@ inet_cidr_pton_ipv6(const char *src, u_char *dst, int *pbits) {
inet_cidr_pton_ipv4(curtok, tp, &bits, 1) == 0) {
tp += NS_INADDRSZ;
saw_xdigit = 0;
- break; /* '\0' was seen by inet_pton4(). */
+ break; /*%< '\\0' was seen by inet_pton4(). */
}
if (ch == '/') {
bits = getbits(src, 1);
@@ -258,20 +258,22 @@ getbits(const char *src, int ipv6) {
int bits = 0;
char *cp, ch;
- if (*src == '\0') /* syntax */
+ if (*src == '\0') /*%< syntax */
return (-2);
do {
ch = *src++;
cp = strchr(digits, ch);
- if (cp == NULL) /* syntax */
+ if (cp == NULL) /*%< syntax */
return (-2);
bits *= 10;
bits += cp - digits;
- if (bits == 0 && *src != '\0') /* no leading zeros */
+ if (bits == 0 && *src != '\0') /*%< no leading zeros */
return (-2);
- if (bits > (ipv6 ? 128 : 32)) /* range error */
+ if (bits > (ipv6 ? 128 : 32)) /*%< range error */
return (-2);
} while (*src != '\0');
return (bits);
}
+
+/*! \file */
OpenPOWER on IntegriCloud