CVS commit: src/lib/libc/net

2024-05-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu May  9 21:28:00 UTC 2024

Modified Files:
src/lib/libc/net: getaddrinfo.3

Log Message:
Document that freeaddrinfo(NULL) dumps core.

A source code comment already said this, but it's easier to
find in a man page.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/lib/libc/net/getaddrinfo.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2024-02-16 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Feb 16 22:50:33 UTC 2024

Modified Files:
src/lib/libc/net: getnameinfo.3

Log Message:
getnameinfo(3): fix/prettify markup


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/lib/libc/net/getnameinfo.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2024-02-16 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Feb 16 22:50:33 UTC 2024

Modified Files:
src/lib/libc/net: getnameinfo.3

Log Message:
getnameinfo(3): fix/prettify markup


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/lib/libc/net/getnameinfo.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getnameinfo.3
diff -u src/lib/libc/net/getnameinfo.3:1.43 src/lib/libc/net/getnameinfo.3:1.44
--- src/lib/libc/net/getnameinfo.3:1.43	Thu Feb 15 15:08:23 2024
+++ src/lib/libc/net/getnameinfo.3	Fri Feb 16 22:50:33 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getnameinfo.3,v 1.43 2024/02/15 15:08:23 jkoshy Exp $
+.\"	$NetBSD: getnameinfo.3,v 1.44 2024/02/16 22:50:33 uwe Exp $
 .\"	$KAME: getnameinfo.3,v 1.37 2005/01/05 03:23:05 itojun Exp $
 .\"	$OpenBSD: getnameinfo.3,v 1.36 2004/12/21 09:48:20 jmc Exp $
 .\"
@@ -23,17 +23,25 @@
 .Sh NAME
 .Nm getnameinfo
 .Nd socket address structure to hostname and service name
+.
 .Sh SYNOPSIS
 .In netdb.h
+.
 .Ft int
-.Fn getnameinfo "const struct sockaddr * restrict sa" "socklen_t salen" \
-"char * restrict host" "socklen_t hostlen" "char * restrict serv" \
-"socklen_t servlen" "int flags"
+.Fo getnameinfo
+.Fa "const struct sockaddr * restrict sa"
+.Fa "socklen_t salen"
+.Fa "char * restrict host"
+.Fa "socklen_t hostlen"
+.Fa "char * restrict serv"
+.Fa "socklen_t servlen" "int flags"
+.Fc
+.
 .Sh DESCRIPTION
 The
 .Fn getnameinfo
 function is used to convert a
-.Li sockaddr
+.Vt sockaddr
 structure to a pair of host name and service strings.
 It is a replacement for and provides more flexibility than the
 .Xr gethostbyaddr 3
@@ -44,20 +52,20 @@ functions and is the converse of the
 function.
 .Pp
 The
-.Li sockaddr
+.Vt sockaddr
 structure
 .Fa sa
 should point to a
-.Li sockaddr_in
+.Vt sockaddr_in
 (for IPv4),
-.Li sockaddr_in6
+.Vt sockaddr_in6
 (for IPv6),
-.Li sockaddr_atalk
+.Vt sockaddr_atalk
 (for AppleTalk),
-.Li sockaddr_link
+.Vt sockaddr_link
 (for link layer),
 or
-.Li sockaddr_local
+.Vt sockaddr_local
 (for local/unix)
 structures that are
 .Fa salen
@@ -85,14 +93,16 @@ as defined by
 .In netdb.h .
 If a length parameter is zero, no string will be stored.
 Otherwise, enough space must be provided to store the
-host name or service string plus a byte for the NUL terminator.
+host name or service string plus a byte for the
+.Tn NUL
+terminator.
 .Pp
 The
 .Fa flags
 argument is formed by
-.Sy OR Ns 'ing
+.Em or Ap ing
 the following values:
-.Bl -tag -width "NI_NUMERICHOSTXX"
+.Bl -tag -width Dv
 .It Dv NI_NOFQDN
 A fully qualified domain name is not required for local hosts.
 The local part of the fully qualified domain name is returned instead.
@@ -106,21 +116,23 @@ If the host name cannot be found in DNS 
 a non-zero error code is returned.
 If the host name is not found and the flag is not set, the
 address is returned in numeric form.
-.It NI_NUMERICSCOPE
+.It Dv NI_NUMERICSCOPE
 For IPv6 addresses the numeric form of the IPv6 scope identifier is
 returned.
 This flag is ignored for non-IPv6 addresses.
-.It NI_NUMERICSERV
+.It Dv NI_NUMERICSERV
 The service name is returned as a digit string representing the port number.
-.It NI_DGRAM
+.It Dv NI_DGRAM
 Specifies that the service being looked up is a datagram
 service, and causes
 .Xr getservbyport 3
 to be called with a second argument of
-.Dq udp
+.Li \*qudp\*q
 instead of its default of
-.Dq tcp .
-This is required for the few ports (512\-514) that have different services
+.Li \*qtcp\*q .
+This is required for the few ports
+.Pq 512\(en514
+that have different services
 for
 .Tn UDP
 and
@@ -128,17 +140,19 @@ and
 .El
 .Pp
 This implementation allows numeric IPv6 address notation with scope identifier,
-as documented in chapter 11 of draft-ietf-ipv6-scoping-arch-02.txt.
+as documented in chapter\~11 of draft-ietf-ipv6-scoping-arch-02.txt.
 IPv6 link-local address will appear as a string like
-.Dq Li fe80::1%ne0 .
+.Ql fe80::1%ne0 .
 Refer to
 .Xr getaddrinfo 3
 for more information.
+.
 .Sh RETURN VALUES
 .Fn getnameinfo
 returns zero on success or one of the error codes listed in
 .Xr gai_strerror 3
 if an error occurs.
+.
 .Sh EXAMPLES
 The following code tries to get a numeric host name, and service name,
 for a given socket address.
@@ -167,6 +181,7 @@ if (getnameinfo(sa, sa->sa_len, hbuf, si
 }
 printf("host=%s\en", hbuf);
 .Ed
+.
 .Sh SEE ALSO
 .Xr gai_strerror 3 ,
 .Xr getaddrinfo 3 ,
@@ -205,6 +220,7 @@ printf("host=%s\en", hbuf);
 .%B "Proceedings of the FREENIX track: 2000 USENIX annual technical conference"
 .%D June 2000
 .Re
+.
 .Sh STANDARDS
 The
 .Fn getnameinfo
@@ -213,19 +229,25 @@ function is defined by the
 draft specification and documented in
 .Sy "RFC 2553" ,
 .Dq Basic Socket Interface Extensions for IPv6 .
+.
 .Sh CAVEATS
 .Fn getnameinfo
-can return both numeric and FQDN forms of the address specified in
+can return both numeric and
+.Tn 

CVS commit: src/lib/libc/net

2024-02-15 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Thu Feb 15 15:08:23 UTC 2024

Modified Files:
src/lib/libc/net: getnameinfo.3

Log Message:
Document the NI_NUMERICSCOPE flag.

PR lib/57832


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/lib/libc/net/getnameinfo.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getnameinfo.3
diff -u src/lib/libc/net/getnameinfo.3:1.42 src/lib/libc/net/getnameinfo.3:1.43
--- src/lib/libc/net/getnameinfo.3:1.42	Mon Jul  3 21:32:49 2017
+++ src/lib/libc/net/getnameinfo.3	Thu Feb 15 15:08:23 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getnameinfo.3,v 1.42 2017/07/03 21:32:49 wiz Exp $
+.\"	$NetBSD: getnameinfo.3,v 1.43 2024/02/15 15:08:23 jkoshy Exp $
 .\"	$KAME: getnameinfo.3,v 1.37 2005/01/05 03:23:05 itojun Exp $
 .\"	$OpenBSD: getnameinfo.3,v 1.36 2004/12/21 09:48:20 jmc Exp $
 .\"
@@ -17,7 +17,7 @@
 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 .\" PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd August 18, 2013
+.Dd February 15, 2024
 .Dt GETNAMEINFO 3
 .Os
 .Sh NAME
@@ -106,6 +106,10 @@ If the host name cannot be found in DNS 
 a non-zero error code is returned.
 If the host name is not found and the flag is not set, the
 address is returned in numeric form.
+.It NI_NUMERICSCOPE
+For IPv6 addresses the numeric form of the IPv6 scope identifier is
+returned.
+This flag is ignored for non-IPv6 addresses.
 .It NI_NUMERICSERV
 The service name is returned as a digit string representing the port number.
 .It NI_DGRAM



CVS commit: src/lib/libc/net

2024-02-15 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Thu Feb 15 15:08:23 UTC 2024

Modified Files:
src/lib/libc/net: getnameinfo.3

Log Message:
Document the NI_NUMERICSCOPE flag.

PR lib/57832


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/lib/libc/net/getnameinfo.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2024-01-21 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 21 12:58:10 UTC 2024

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
Unwrap a line which wasn't wrapped before it had an __UNCONST() added
to it, and now that that is gone again, doesn't need wrapping any more.

That line is now unaltered from what it was 3 revs ago (bit for bit).

NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/lib/libc/net/getaddrinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2024-01-21 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 21 12:58:10 UTC 2024

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
Unwrap a line which wasn't wrapped before it had an __UNCONST() added
to it, and now that that is gone again, doesn't need wrapping any more.

That line is now unaltered from what it was 3 revs ago (bit for bit).

NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/lib/libc/net/getaddrinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.126 src/lib/libc/net/getaddrinfo.c:1.127
--- src/lib/libc/net/getaddrinfo.c:1.126	Sat Jan 20 16:18:56 2024
+++ src/lib/libc/net/getaddrinfo.c	Sun Jan 21 12:58:10 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: getaddrinfo.c,v 1.126 2024/01/20 16:18:56 christos Exp $	*/
+/*	$NetBSD: getaddrinfo.c,v 1.127 2024/01/21 12:58:10 kre Exp $	*/
 /*	$KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $	*/
 
 /*
@@ -55,7 +55,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getaddrinfo.c,v 1.126 2024/01/20 16:18:56 christos Exp $");
+__RCSID("$NetBSD: getaddrinfo.c,v 1.127 2024/01/21 12:58:10 kre Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifndef RUMP_ACTION
@@ -1440,8 +1440,7 @@ explore_numeric_scope(const struct addri
 			if (cur->ai_family != AF_INET6)
 continue;
 			sin6 = (struct sockaddr_in6 *)(void *)cur->ai_addr;
-			if (ip6_str2scopeid(scope, sin6, )
-			== -1) {
+			if (ip6_str2scopeid(scope, sin6, ) == -1) {
 free(hostname2);
 return EAI_NODATA; /* XXX: is return OK? */
 			}



CVS commit: src/lib/libc/net

2024-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 20 16:18:56 UTC 2024

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
Make the first argument of ip6_str2scopeid const, instead of __UNCONST.
Thanks kre@. While here s/u_int32_t/uint32_t/


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/lib/libc/net/getaddrinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.125 src/lib/libc/net/getaddrinfo.c:1.126
--- src/lib/libc/net/getaddrinfo.c:1.125	Sat Jan 20 09:52:48 2024
+++ src/lib/libc/net/getaddrinfo.c	Sat Jan 20 11:18:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: getaddrinfo.c,v 1.125 2024/01/20 14:52:48 christos Exp $	*/
+/*	$NetBSD: getaddrinfo.c,v 1.126 2024/01/20 16:18:56 christos Exp $	*/
 /*	$KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $	*/
 
 /*
@@ -55,7 +55,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getaddrinfo.c,v 1.125 2024/01/20 14:52:48 christos Exp $");
+__RCSID("$NetBSD: getaddrinfo.c,v 1.126 2024/01/20 16:18:56 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifndef RUMP_ACTION
@@ -196,7 +196,7 @@ struct ai_order {
 		struct sockaddr aiou_sa;
 	} aio_src_un;
 #define aio_srcsa aio_src_un.aiou_sa
-	u_int32_t aio_srcflag;
+	uint32_t aio_srcflag;
 	int aio_srcscope;
 	int aio_dstscope;
 	struct policyqueue *aio_srcpolicy;
@@ -257,7 +257,7 @@ static void set_source(struct ai_order *
 struct servent_data *);
 static int comp_dst(const void *, const void *);
 #ifdef INET6
-static int ip6_str2scopeid(char *, struct sockaddr_in6 *, u_int32_t *);
+static int ip6_str2scopeid(const char *, struct sockaddr_in6 *, uint32_t *);
 #endif
 static int gai_addr2scopetype(struct sockaddr *);
 
@@ -921,7 +921,7 @@ set_source(struct ai_order *aio, struct 
 #ifdef INET6
 	if (ai.ai_family == AF_INET6) {
 		struct in6_ifreq ifr6;
-		u_int32_t flags6;
+		uint32_t flags6;
 
 		memset(, 0, sizeof(ifr6));
 		memcpy(_addr, ai.ai_addr, ai.ai_addrlen);
@@ -1434,13 +1434,13 @@ explore_numeric_scope(const struct addri
 
 	error = explore_numeric(pai, addr, servname, res, hostname, svd);
 	if (error == 0) {
-		u_int32_t scopeid;
+		uint32_t scopeid;
 
 		for (cur = *res; cur; cur = cur->ai_next) {
 			if (cur->ai_family != AF_INET6)
 continue;
 			sin6 = (struct sockaddr_in6 *)(void *)cur->ai_addr;
-			if (ip6_str2scopeid(__UNCONST(scope), sin6, )
+			if (ip6_str2scopeid(scope, sin6, )
 			== -1) {
 free(hostname2);
 return EAI_NODATA; /* XXX: is return OK? */
@@ -1644,7 +1644,7 @@ addrconfig(uint64_t *mask)
 #ifdef INET6
 /* convert a string to a scope identifier. XXX: IPv6 specific */
 static int
-ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, u_int32_t *scopeid)
+ip6_str2scopeid(const char *scope, struct sockaddr_in6 *sin6, uint32_t *scopeid)
 {
 	u_long lscopeid;
 	struct in6_addr *a6;
@@ -1684,7 +1684,7 @@ ip6_str2scopeid(char *scope, struct sock
   trynumeric:
 	errno = 0;
 	lscopeid = strtoul(scope, , 10);
-	*scopeid = (u_int32_t)(lscopeid & 0xUL);
+	*scopeid = (uint32_t)(lscopeid & 0xUL);
 	if (errno == 0 && ep && *ep == '\0' && *scopeid == lscopeid)
 		return 0;
 	else



CVS commit: src/lib/libc/net

2024-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 20 16:18:56 UTC 2024

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
Make the first argument of ip6_str2scopeid const, instead of __UNCONST.
Thanks kre@. While here s/u_int32_t/uint32_t/


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/lib/libc/net/getaddrinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2023-12-07 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Dec  7 22:33:49 UTC 2023

Modified Files:
src/lib/libc/net: sethostent.c

Log Message:
Fix a couple of (not very likely) memory leaks, reported by e...@google.com
who attributed them:

  the malloc one was reported to Android (as
  https://android-review.googlesource.com/c/platform/bionic/+/2856549)
  by wuhaitao3 ; Chris Ferris
   then spotted the goto nospc one.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/net/sethostent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/sethostent.c
diff -u src/lib/libc/net/sethostent.c:1.20 src/lib/libc/net/sethostent.c:1.21
--- src/lib/libc/net/sethostent.c:1.20	Mon Mar 17 13:24:23 2014
+++ src/lib/libc/net/sethostent.c	Thu Dec  7 22:33:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sethostent.c,v 1.20 2014/03/17 13:24:23 christos Exp $	*/
+/*	$NetBSD: sethostent.c,v 1.21 2023/12/07 22:33:49 kre Exp $	*/
 
 /*
  * Copyright (c) 1985, 1993
@@ -35,7 +35,7 @@
 static char sccsid[] = "@(#)sethostent.c	8.1 (Berkeley) 6/4/93";
 static char rcsid[] = "Id: sethostent.c,v 8.5 1996/09/28 06:51:07 vixie Exp ";
 #else
-__RCSID("$NetBSD: sethostent.c,v 1.20 2014/03/17 13:24:23 christos Exp $");
+__RCSID("$NetBSD: sethostent.c,v 1.21 2023/12/07 22:33:49 kre Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -171,6 +171,7 @@ _hf_gethtbyname2(const char *name, int a
 	}
 
 	if ((ptr = buf = malloc(len = info->buflen)) == NULL) {
+		endhostent_r();
 		*info->he = NETDB_INTERNAL;
 		return NULL;
 	}
@@ -251,6 +252,7 @@ _hf_gethtbyname2(const char *name, int a
 	free(buf);
 	return hp;
 nospc:
+	endhostent_r();
 	*info->he = NETDB_INTERNAL;
 	free(buf);
 	errno = ENOSPC;



CVS commit: src/lib/libc/net

2023-12-07 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Dec  7 22:33:49 UTC 2023

Modified Files:
src/lib/libc/net: sethostent.c

Log Message:
Fix a couple of (not very likely) memory leaks, reported by e...@google.com
who attributed them:

  the malloc one was reported to Android (as
  https://android-review.googlesource.com/c/platform/bionic/+/2856549)
  by wuhaitao3 ; Chris Ferris
   then spotted the goto nospc one.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/net/sethostent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2023-09-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  8 18:17:41 UTC 2023

Modified Files:
src/lib/libc/net: getnameinfo.c

Log Message:
PR/57609: Carl Engvall: Add salen checks but accept larger sizes
(upto sockaddr_storage)


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/lib/libc/net/getnameinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getnameinfo.c
diff -u src/lib/libc/net/getnameinfo.c:1.59 src/lib/libc/net/getnameinfo.c:1.60
--- src/lib/libc/net/getnameinfo.c:1.59	Tue Sep 22 12:15:08 2015
+++ src/lib/libc/net/getnameinfo.c	Fri Sep  8 14:17:41 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: getnameinfo.c,v 1.59 2015/09/22 16:15:08 christos Exp $	*/
+/*	$NetBSD: getnameinfo.c,v 1.60 2023/09/08 18:17:41 christos Exp $	*/
 /*	$KAME: getnameinfo.c,v 1.45 2000/09/25 22:43:56 itojun Exp $	*/
 
 /*
@@ -47,7 +47,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getnameinfo.c,v 1.59 2015/09/22 16:15:08 christos Exp $");
+__RCSID("$NetBSD: getnameinfo.c,v 1.60 2023/09/08 18:17:41 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifndef RUMP_ACTION
@@ -128,6 +128,13 @@ getnameinfo(const struct sockaddr *sa, s
 	int flags)
 {
 
+	/*  
+	 * getnameinfo() accepts an salen of sizeof(struct sockaddr_storage)
+	 * at maximum as shown in RFC 4038 Sec.6.2.3.
+	 */ 
+	if (salen > sizeof(struct sockaddr_storage))
+		return EAI_FAMILY;
+
 	switch (sa->sa_family) {
 	case AF_APPLETALK:
 		return getnameinfo_atalk(sa, salen, host, hostlen,
@@ -220,6 +227,9 @@ getnameinfo_local(const struct sockaddr 
 	const struct sockaddr_un *sun =
 	(const struct sockaddr_un *)(const void *)sa;
 
+if (salen <= sizeof(*sun) - sizeof(sun->sun_path))
+		return EAI_FAMILY;
+
 	if (serv != NULL && servlen > 0)
 		serv[0] = '\0';
 
@@ -266,8 +276,8 @@ getnameinfo_inet(const struct sockaddr *
 	return EAI_FAMILY;
 
  found:
-	if (salen != afd->a_socklen)
-		return EAI_FAIL;
+	if (salen < afd->a_socklen)
+		return EAI_FAMILY;
 
 	/* network byte order */
 	port = ((const struct sockinet *)(const void *)sa)->si_port;
@@ -544,6 +554,9 @@ getnameinfo_link(const struct sockaddr *
 	const struct ieee1394_hwaddr *iha;
 	int n;
 
+if (salen <= sizeof(*sdl) - sizeof(sdl->sdl_data))
+		return EAI_FAMILY;
+
 	if (serv != NULL && servlen > 0)
 		*serv = '\0';
 



CVS commit: src/lib/libc/net

2023-09-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  8 18:17:41 UTC 2023

Modified Files:
src/lib/libc/net: getnameinfo.c

Log Message:
PR/57609: Carl Engvall: Add salen checks but accept larger sizes
(upto sockaddr_storage)


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/lib/libc/net/getnameinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2022-12-03 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Dec  4 00:13:11 UTC 2022

Modified Files:
src/lib/libc/net: getservent.3

Log Message:
getservent(3): Section 3 has RETURN VALUES, not DIAGNOSTICS

While here, don't claim that null pointer is zero.

We should probably just pick the wording from POSIX, but that yak is a
bit too big for me to shave at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/net/getservent.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getservent.3
diff -u src/lib/libc/net/getservent.3:1.15 src/lib/libc/net/getservent.3:1.16
--- src/lib/libc/net/getservent.3:1.15	Sat Dec  3 23:55:52 2022
+++ src/lib/libc/net/getservent.3	Sun Dec  4 00:13:11 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getservent.3,v 1.15 2022/12/03 23:55:52 jschauma Exp $
+.\"	$NetBSD: getservent.3,v 1.16 2022/12/04 00:13:11 uwe Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -129,9 +129,8 @@ searches must also match the protocol.
 .It Pa /etc/services
 .It Pa /var/db/services.cdb
 .El
-.Sh DIAGNOSTICS
-Null pointer
-(0) returned on
+.Sh RETURN VALUES
+Null pointer is returned on
 .Dv EOF
 or error.
 .Sh SEE ALSO



CVS commit: src/lib/libc/net

2022-12-03 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Dec  4 00:13:11 UTC 2022

Modified Files:
src/lib/libc/net: getservent.3

Log Message:
getservent(3): Section 3 has RETURN VALUES, not DIAGNOSTICS

While here, don't claim that null pointer is zero.

We should probably just pick the wording from POSIX, but that yak is a
bit too big for me to shave at the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/net/getservent.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2022-12-03 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Sat Dec  3 23:55:52 UTC 2022

Modified Files:
src/lib/libc/net: getservent.3

Log Message:
reference /var/db/services.cdb / services_mkdb(8)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/net/getservent.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2022-12-03 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Sat Dec  3 23:55:52 UTC 2022

Modified Files:
src/lib/libc/net: getservent.3

Log Message:
reference /var/db/services.cdb / services_mkdb(8)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/net/getservent.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getservent.3
diff -u src/lib/libc/net/getservent.3:1.14 src/lib/libc/net/getservent.3:1.15
--- src/lib/libc/net/getservent.3:1.14	Thu Aug  7 16:43:10 2003
+++ src/lib/libc/net/getservent.3	Sat Dec  3 23:55:52 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getservent.3,v 1.14 2003/08/07 16:43:10 agc Exp $
+.\"	$NetBSD: getservent.3,v 1.15 2022/12/03 23:55:52 jschauma Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)getservent.3  8.4 (Berkeley) 5/25/95
 .\"
-.Dd May 25, 1995
+.Dd December 03, 2022
 .Dt GETSERVENT 3
 .Os
 .Sh NAME
@@ -127,6 +127,7 @@ searches must also match the protocol.
 .Sh FILES
 .Bl -tag -width /etc/services -compact
 .It Pa /etc/services
+.It Pa /var/db/services.cdb
 .El
 .Sh DIAGNOSTICS
 Null pointer
@@ -135,7 +136,8 @@ Null pointer
 or error.
 .Sh SEE ALSO
 .Xr getprotoent 3 ,
-.Xr services 5
+.Xr services 5 ,
+.Xr services_mkdb 8
 .Sh HISTORY
 The
 .Fn getservent ,



CVS commit: src/lib/libc/net

2022-03-12 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Mar 12 08:43:12 UTC 2022

Modified Files:
src/lib/libc/net: getservent_r.c

Log Message:
getservent_r: use reallocarr
CVSv --


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/net/getservent_r.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getservent_r.c
diff -u src/lib/libc/net/getservent_r.c:1.11 src/lib/libc/net/getservent_r.c:1.12
--- src/lib/libc/net/getservent_r.c:1.11	Sat Oct 15 23:00:02 2011
+++ src/lib/libc/net/getservent_r.c	Sat Mar 12 08:43:11 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: getservent_r.c,v 1.11 2011/10/15 23:00:02 christos Exp $	*/
+/*	$NetBSD: getservent_r.c,v 1.12 2022/03/12 08:43:11 nia Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)getservent.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: getservent_r.c,v 1.11 2011/10/15 23:00:02 christos Exp $");
+__RCSID("$NetBSD: getservent_r.c,v 1.12 2022/03/12 08:43:11 nia Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -291,9 +291,12 @@ _servent_parsedb(struct servent_data *sd
 
 	if (sd->aliases == NULL) {
 		sd->maxaliases = 10;
-		sd->aliases = malloc(sd->maxaliases * sizeof(char *));
-		if (sd->aliases == NULL)
+		sd->aliases = NULL;
+		if (reallocarr(>aliases,
+		sd->maxaliases, sizeof(char *)) != 0) {
+			errno = ENOMEM;
 			goto fail;
+		}
 	}
 	sp->s_aliases = sd->aliases;
 	i = 0;
@@ -302,9 +305,11 @@ _servent_parsedb(struct servent_data *sd
 			goto fail;
 		if (i == sd->maxaliases - 2) {
 			sd->maxaliases *= 2;
-			q = realloc(sd->aliases, sd->maxaliases * sizeof(*q));
-			if (q == NULL)
+			q = sd->aliases;
+			if (reallocarr(, sd->maxaliases, sizeof(*q)) != 0) {
+errno = ENOMEM;
 goto fail;
+			}
 			sp->s_aliases = sd->aliases = q;
 		}
 		sp->s_aliases[i++] = __UNCONST(data + 1);



CVS commit: src/lib/libc/net

2022-03-12 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Mar 12 08:43:12 UTC 2022

Modified Files:
src/lib/libc/net: getservent_r.c

Log Message:
getservent_r: use reallocarr
CVSv --


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/net/getservent_r.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2022-03-12 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Mar 12 08:41:38 UTC 2022

Modified Files:
src/lib/libc/net: getprotoent_r.c

Log Message:
getprotoent_r: use reallocarr


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/net/getprotoent_r.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2022-03-12 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Mar 12 08:41:38 UTC 2022

Modified Files:
src/lib/libc/net: getprotoent_r.c

Log Message:
getprotoent_r: use reallocarr


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/net/getprotoent_r.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getprotoent_r.c
diff -u src/lib/libc/net/getprotoent_r.c:1.6 src/lib/libc/net/getprotoent_r.c:1.7
--- src/lib/libc/net/getprotoent_r.c:1.6	Sat Oct 15 23:00:02 2011
+++ src/lib/libc/net/getprotoent_r.c	Sat Mar 12 08:41:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: getprotoent_r.c,v 1.6 2011/10/15 23:00:02 christos Exp $	*/
+/*	$NetBSD: getprotoent_r.c,v 1.7 2022/03/12 08:41:38 nia Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)getprotoent.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: getprotoent_r.c,v 1.6 2011/10/15 23:00:02 christos Exp $");
+__RCSID("$NetBSD: getprotoent_r.c,v 1.7 2022/03/12 08:41:38 nia Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -87,7 +87,6 @@ getprotoent_r(struct protoent *pr, struc
 {
 	char *p, *cp, **q;
 	size_t i = 0;
-	int oerrno;
 
 	if (pd->fp == NULL && (pd->fp = fopen(_PATH_PROTOCOLS, "re")) == NULL)
 		return NULL;
@@ -111,12 +110,12 @@ getprotoent_r(struct protoent *pr, struc
 			*p++ = '\0';
 		pr->p_proto = atoi(cp);
 		if (pd->aliases == NULL) {
+			pd->aliases = NULL;
 			pd->maxaliases = 10;
-			pd->aliases = malloc(pd->maxaliases * sizeof(char *));
-			if (pd->aliases == NULL) {
-oerrno = errno;
+			if (reallocarr(>aliases,
+			pd->maxaliases, sizeof(char *)) != 0) {
 endprotoent_r(pd);
-errno = oerrno;
+errno = ENOMEM;
 return NULL;
 			}
 		}
@@ -130,12 +129,10 @@ getprotoent_r(struct protoent *pr, struc
 }
 if (i == pd->maxaliases - 2) {
 	pd->maxaliases *= 2;
-	q = realloc(q,
-	pd->maxaliases * sizeof(char *));
-	if (q == NULL) {
-		oerrno = errno;
+	if (reallocarr(,
+	pd->maxaliases, sizeof(char *)) != 0) {
 		endprotoent_r(pd);
-		errno = oerrno;
+		errno = ENOMEM;
 		return NULL;
 	}
 	pr->p_aliases = pd->aliases = q;



CVS commit: src/lib/libc/net

2021-10-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Oct 28 20:56:32 UTC 2021

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
Fix typo in comment: allows, not alows.

I don't know what an alow is, maybe some cousin of the alot.
Awaiting a nature documentary by Allie Brosh about these perhaps more
elusive beasts.

PR misc/56473, from jschauma


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/lib/libc/net/getaddrinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.121 src/lib/libc/net/getaddrinfo.c:1.122
--- src/lib/libc/net/getaddrinfo.c:1.121	Wed Oct 27 19:24:38 2021
+++ src/lib/libc/net/getaddrinfo.c	Thu Oct 28 20:56:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: getaddrinfo.c,v 1.121 2021/10/27 19:24:38 nia Exp $	*/
+/*	$NetBSD: getaddrinfo.c,v 1.122 2021/10/28 20:56:32 riastradh Exp $	*/
 /*	$KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $	*/
 
 /*
@@ -36,7 +36,7 @@
  *   in the source code.  This is because RFC2553 is silent about which error
  *   code must be returned for which situation.
  * - IPv4 classful (shortened) form.  RFC2553 is silent about it.  XNET 5.2
- *   says to use inet_aton() to convert IPv4 numeric to binary (alows
+ *   says to use inet_aton() to convert IPv4 numeric to binary (allows
  *   classful form as a result).
  *   current code - disallow classful form for IPv4 (due to use of inet_pton).
  * - freeaddrinfo(NULL).  RFC2553 is silent about it.  XNET 5.2 says it is
@@ -55,7 +55,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getaddrinfo.c,v 1.121 2021/10/27 19:24:38 nia Exp $");
+__RCSID("$NetBSD: getaddrinfo.c,v 1.122 2021/10/28 20:56:32 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifndef RUMP_ACTION



CVS commit: src/lib/libc/net

2021-10-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Oct 28 20:56:32 UTC 2021

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
Fix typo in comment: allows, not alows.

I don't know what an alow is, maybe some cousin of the alot.
Awaiting a nature documentary by Allie Brosh about these perhaps more
elusive beasts.

PR misc/56473, from jschauma


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/lib/libc/net/getaddrinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2021-10-27 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Oct 27 19:24:38 UTC 2021

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
getaddrinfo(3): malloc + memset -> calloc


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/lib/libc/net/getaddrinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2021-10-27 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Oct 27 19:24:38 UTC 2021

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
getaddrinfo(3): malloc + memset -> calloc


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/lib/libc/net/getaddrinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.120 src/lib/libc/net/getaddrinfo.c:1.121
--- src/lib/libc/net/getaddrinfo.c:1.120	Wed Nov 18 12:49:52 2020
+++ src/lib/libc/net/getaddrinfo.c	Wed Oct 27 19:24:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: getaddrinfo.c,v 1.120 2020/11/18 12:49:52 is Exp $	*/
+/*	$NetBSD: getaddrinfo.c,v 1.121 2021/10/27 19:24:38 nia Exp $	*/
 /*	$KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $	*/
 
 /*
@@ -55,7 +55,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getaddrinfo.c,v 1.120 2020/11/18 12:49:52 is Exp $");
+__RCSID("$NetBSD: getaddrinfo.c,v 1.121 2021/10/27 19:24:38 nia Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifndef RUMP_ACTION
@@ -717,9 +717,8 @@ reorder(struct addrinfo *sentinel, struc
 		return n;
 
 	/* allocate a temporary array for sort and initialization of it. */
-	if ((aio = malloc(sizeof(*aio) * n)) == NULL)
+	if ((aio = calloc(n, sizeof(*aio))) == NULL)
 		return n;	/* give up reordering */
-	memset(aio, 0, sizeof(*aio) * n);
 
 	/* retrieve address selection policy from the kernel */
 	TAILQ_INIT();



CVS commit: src/lib/libc/net

2019-05-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 02:30:43 UTC 2019

Modified Files:
src/lib/libc/net: rthdr.c

Log Message:
 Fix typo(s/suppport/support/) in comment. From FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/net/rthdr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/net

2019-05-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 02:30:43 UTC 2019

Modified Files:
src/lib/libc/net: rthdr.c

Log Message:
 Fix typo(s/suppport/support/) in comment. From FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/net/rthdr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/rthdr.c
diff -u src/lib/libc/net/rthdr.c:1.18 src/lib/libc/net/rthdr.c:1.19
--- src/lib/libc/net/rthdr.c:1.18	Tue Mar 13 21:13:42 2012
+++ src/lib/libc/net/rthdr.c	Wed May 29 02:30:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rthdr.c,v 1.18 2012/03/13 21:13:42 christos Exp $	*/
+/*	$NetBSD: rthdr.c,v 1.19 2019/05/29 02:30:42 msaitoh Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: rthdr.c,v 1.18 2012/03/13 21:13:42 christos Exp $");
+__RCSID("$NetBSD: rthdr.c,v 1.19 2019/05/29 02:30:42 msaitoh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -289,7 +289,7 @@ inet6_rth_space(int type, int segments)
 	case IPV6_RTHDR_TYPE_0:
 		return (((segments * 2) + 1) << 3);
 	default:
-		return (0);	/* type not suppported */
+		return (0);	/* type not supported */
 	}
 }
 



Re: CVS commit: src/lib/libc/net

2016-12-06 Thread David Holland
On Tue, Dec 06, 2016 at 01:41:03PM -0500, Christos Zoulas wrote:
 > Module Name: src
 > Committed By:christos
 > Date:Tue Dec  6 18:41:03 UTC 2016
 > 
 > Modified Files:
 >  src/lib/libc/net: linkaddr.c
 > 
 > Log Message:
 > Fix buffer copy without checking the size of input:
 > https://www.kb.cert.org/vuls/id/548487

Doesn't this need 

-   if (out >= obuf + sizeof(obuf)) \
+   if (out >= obuf + sizeof(obuf) - 1) \

to avoid having the null terminator off the end?

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/lib/libc/net

2016-09-21 Thread Roy Marples
On 21/09/2016 13:10, Ryo ONODERA wrote:
> Adding ifa_addrflags definition to src/include/ifaddrs.h is required?

It is! I forgot that file from my commit, fixed now.

Roy


Re: CVS commit: src/lib/libc/net

2016-09-21 Thread Ryo ONODERA
Hi,

Adding ifa_addrflags definition to src/include/ifaddrs.h is required?

From: "Roy Marples" , Date: Wed, 21 Sep 2016 10:53:24 +

> Module Name:  src
> Committed By: roy
> Date: Wed Sep 21 10:53:24 UTC 2016
> 
> Modified Files:
>   src/lib/libc/net: getifaddrs.3 getifaddrs.c
> 
> Log Message:
> Add ifa_addrflags to ifaddrs.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.16 -r1.17 src/lib/libc/net/getifaddrs.3
> cvs rdiff -u -r1.15 -r1.16 src/lib/libc/net/getifaddrs.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

--
Ryo ONODERA // ryo...@yk.rim.or.jp
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Re: CVS commit: src/lib/libc/net

2015-11-04 Thread Robert Elz
Date:Wed, 04 Nov 2015 14:02:12 +0100 (CET)
From:Havard Eidnes 
Message-ID:  <20151104.140212.184674982...@uninett.no>

  | 952, referred to from 1123.

That's just fine if your intent is to put a host name in HOSTS.TXT
That's all 952 applies to.   If that is your intent, then certainly
you must comply with its syntax.

  | I beleive that in the context of the DNS, the customary
  | definition of a hostname is a DNS name which has either an A or a
  |  record registered on it.

Where does that definition come from?   Customary where?   The only
explanation for that assumption I can imagine, is that HOSTS.TXT just
bound names to addresses, so the part of the DNS that does the same
could be considered to be mapping host names too - but that doesn't
(in any way) imply that the 952 syntax for names applies to anything
in the DNS, it (if it even exists) would just be a shorthand terminology.

If the DNS spec had wanted to limit the syntax of names, or even the
syntax of some names (which would be a truly bizarre design decision)
then it would have done so explicitly.

On the contrary, pains were taken to ensure that no such requirements
would be necessary, with all DNS names being explicitly octet strings
with an explicit length field, so no internal decoding would be required.
(that is aside from the A==a stuff, which was understandable at the time,
but is a true nuisance now.)

  | If I'm not much mistaken, that's
  | the interpretation implemented by BIND's "check-names" feature:

check-names in general is a botch, and should never have been implemented.

As it applies to primary zone files, it is OK, in that sites are free
to put whatever syntax/semantic meanings they like on their own names,
and if they do, refusing to load a zone in which someone has accidentally
violated the rules, is a reasonable way to enforce the policy.   For that,
check-names is ok, though gives sites almost no control over what policy
they'd like to implement.

For secondary zones, and the cache, it is utter nonsense, and should be
removed (and if not removed, should certainly be disabled.)

  | I'm not entirely certain I agree.  If you're looking up A or 
  | information, you're looking up a host name,

If that's how you have defined host name, then yes.

  | and some syntactical restrictions may apply 

They maybe some, but what restrictions?   It all depends on how the name is
to be used.  For obtaining the address, there is no need for any restriction
at all, the DNS can handle anything, but where the name is going to be used
in some other way, there may very well be all kinds of restructions.

But how can you possibly expect the name lookup routines to understand that?

  | if you wish to adhere to the restrictions in RFC 952.

If you wish to adhere to those rules for some reason, then you only create
names that comply, and you can ignore lookup attempts - if something looks
up a name that doesn't comply, it will simply fail to be found.

That is, even if you believe there should be some syntax requirement on names,
implementing that in the name lookup is the wrong place to do it, the correct
way is to limit the names that can be created in the first place.   That
would be check-names on a primary zone, or similar.

kre



Re: CVS commit: src/lib/libc/net

2015-11-04 Thread Steffen Nurpmeso
Robert Elz  wrote:
 |Which standard?

RFC 1035 2.3.1 defines hostnames.

 |ps: do go read section 11 of rfc2181 while you're pondering all of this.

I think RFC 6895 would then be for the better:

3.3.1.  Label Types

   At the present time, there are two categories of label types: data
   labels and compression labels.  Compression labels are pointers to
   data labels elsewhere within an RR or DNS message and are intended to
   shorten the wire encoding of NAMEs.

   The two existing data label types are sometimes referred to as Text
   and Binary.  Text labels can, in fact, include any octet value
   including zero-value octets, but many current uses involve only
   printing ASCII characters [US-ASCII].  For retrieval, Text labels are
   defined to treat ASCII uppercase and lowercase letter codes as
   matching [RFC4343].  Binary labels are bit sequences [RFC2673].  The
   Binary Label type is Historic [RFC6891].

Thank you.

--steffen

 |ps: do go read section 11 of rfc2181 while you're pondering all of this.

For my own taste all those other RFCs from all those honorable
people are not outweighed by a single sentence of an RFC that
otherwise pushes forward that completely refusable DNSSEC system
that i personally did not implement consciously back in 2004+.
And even a thousand more IETF announcements which read something
like "DNSSEC now enters widespread usage [and here is another one
which aids in supporting another part of the game]" won't change
that.
Instead i'm personally thrilled by draft-ietf-dnsop-5966bis, and
then on top of TLS and a library which gets used a billion times
a time.  But anyway the second half of that sentence.


Re: CVS commit: src/lib/libc/net

2015-11-04 Thread Havard Eidnes
>   | So, what did we do by default: allow "_" in hostnames when that's
>   | explicitly against standard, or not?
>
> Which standard?

952, referred to from 1123.

> There's RFC952 that specifies the format of HOSTS.TXT (from 1985).
> (The update in Hosts Requirements isn't material, one way or the other, here.)
>
> What else?   In fact, aside from being listed in HOSTS.TXT, what exactly
> is a hostname?   Is it defined somewhere?

I beleive that in the context of the DNS, the customary
definition of a hostname is a DNS name which has either an A or a
 record registered on it.  If I'm not much mistaken, that's
the interpretation implemented by BIND's "check-names" feature:
when turned on, it allows underscores in DNS names as long as
those names don't have A or  information registered on them,
but either complains or errs depending on the value of the option
in BINDs configuration.

> But library functions, like the resolver library, and getaddrinfo(),
> and the older variants, have no idea why the DNS is being consulted, they
> don't know, generally, what rules are intended to apply - they cannot
> possibly legitimately object to anything (getaddrinfo() when given a port
> as well might guess what rules might apply, but even then it cannot know
> for sure .. the name it is being looked up, if the port is "http" (or 80)
> or "https" (or 443) then the name being looked up might be the hostname
> from a URL, which has some syntax constraints, or it might be the name
> configured as the local proxy server, which does not - it is just a key to
> use to extract an address from the DNS.)
>
> There is no rational way that those functions can ever validate name
> syntax, and get it correct.

I'm not entirely certain I agree.  If you're looking up A or 
information, you're looking up a host name, and some syntactical
restrictions may apply (optionally turned on/off?) if you wish to
adhere to the restrictions in RFC 952.

If you're looking up other information in DNS, I agree that there
should be no restrictions on the name being looked up, ref.
section 11 in RFC 2187.

Regards,

- Håvard


Re: CVS commit: src/lib/libc/net

2015-11-03 Thread Robert Elz
Date:Sun, 1 Nov 2015 23:45:36 -0800
From:Erik Fair 
Message-ID:  <56dd2b5f-26b1-40b7-bd84-103d3f255...@netbsd.org>

  | So, what did we do by default: allow "_" in hostnames when that's
  | explicitly against standard, or not?

Which standard?

There's RFC952 that specifies the format of HOSTS.TXT (from 1985).
(The update in Hosts Requirements isn't material, one way or the other, here.)

What else?   In fact, aside from being listed in HOSTS.TXT, what exactly
is a hostname?   Is it defined somewhere?

As far as the DNS goes, there is exactly one syntax requirement, on DNS
names, and that pertains to their length.   Aside from that, anything goes.
There's a recommended syntax to use, but it is just that recommended.

For particular uses, such as as the domain name in an e-mail address,
there are more restrictive requirements.   Other protocols that pass names
as data likely have syntax limitations as well (just what those are
tends to depend upon the protocol.)   Observing the DNS recommendation for
names is very likely to make the name suitable for any of those uses.
That's why it exists.

But the DNS can also be used for all kinds of other purposes -- some
of the labels used there are purely internal DNS labels, and have no other
use at all (such as the labels found in the data of NS records.)   There
are no syntax requirements (aside from lengths) on those labels.   None.

If you're considering a name from the domain name part of an e-mail address,
then it makes perfect sense to syntax check it, according to the rules in
rfc5322 (or 2822, or 822, or 733, or whatever even older version you're
using...)   If you're sending a name in a HTTP transaction, you'll need to
syntax check it to make sure it meets the applicable rules (whatever those 
are.)

But library functions, like the resolver library, and getaddrinfo(),
and the older variants, have no idea why the DNS is being consulted, they
don't know, generally, what rules are intended to apply - they cannot
possibly legitimately object to anything (getaddrinfo() when given a port
as well might guess what rules might apply, but even then it cannot know
for sure .. the name it is being looked up, if the port is "http" (or 80)
or "https" (or 443) then the name being looked up might be the hostname
from a URL, which has some syntax constraints, or it might be the name
configured as the local proxy server, which does not - it is just a key to
use to extract an address from the DNS.)

There is no rational way that those functions can ever validate name
syntax, and get it correct.

If you believe any of this is incorrect, please be explicit, and quote the
standard that says so - without knowing just what this mythical standard is
that an underscore in hostname apparently explicitly violates, it is very
difficult to refute.

But this requirement is truly an old wives' tale - an urban myth - people
tell each other there is such a rule, it sounds plausible, so they believe
it, and pass it on to others.

kre

ps: do go read section 11 of rfc2181 while you're pondering all of this.


Re: CVS commit: src/lib/libc/net

2015-11-02 Thread Steffen Nurpmeso
Erik Fair  wrote:
 |So, what did we do by default: allow “_” in hostnames when that’s exp\
 |licitly against standard, or not? I read the patch in the PR and coul\
 |dn’t make heads or tails of it.

fwiw i don't think this is generally true, my own one has
a DNS::verifyName() and that does

// find label border, if any
#if(_ASSUME_LONG)
wbuf = s(char*,Mem::Utils::find(_dname, _DOT, _dnamelen));
llen = (wbuf ? s(ui32,wbuf-_dname) : _dnamelen);
#else
for(wbuf=_dname, llen^=llen;  llen < _dnamelen;  ++llen)
if(*(wbuf++) == _DOT)
break;
#endif
if(!llen || llen > 63)
goto jesll;

[and]

// 1033, 1034, 2929 (3.3): rather anything (printable ASCII)
[these numbers are RFCs, vnm_ is enum DNS::VerifyNameMode:
vnm_none= 0,// boundary checks only
vnm_boundary= vnm_none,
vnm_dname   = 1,// printable ASCII
vnm_hostname= 2,// hostname acc. RFC 1035 + 1123, 2.1
vnm_srv = 3,// vnm_hostname plus _ label start
]
case vnm_dname:
while(llen--) {
ui8 c = s(ui8,*(wbuf++));
if(!_IS_ASCII_PRINTABLE(c))
goto jeill;
}
break;

// hostname acc. 1035:2.3.1, 1123:2.1
[these numbers are RFCs]
case vnm_hostname:
case vnm_srv:
// may start with letter or digit (latter 1123, 2.1)
if(!_IS_ASCII_ALNUM(wbuf[0]))
// t_srv may start with underscore (RFC 2782)
if(_vnm != vnm_srv || wbuf[0] != _UNDERSCORE)
goto jeill;
// may consist of letters, digits and hyphen
while(s(si32,--llen) > 0) {
charc = *(++wbuf);
if(c != _HYPHEN && !_IS_ASCII_ALNUM(c))
goto jeill;
}
// but may end with letter or digit only
if(wbuf[0] == _HYPHEN)
goto jeill;
break;
} // switch(_vnm)

and then

  ?0[sdaoden@wales ]$ git grep IS_ASCII_PRI master
  master:modules/dns/config.h:#define _IS_ASCII_PRINTABLE(CHAR) ((CHAR) > 0x20 
&& (CHAR) < 0x7F)

So vnm_srv does regulary allow underscore as in

/*!
* \var vnm_srv
* Boundary check (#vnm_none) plus content verification.
* This is exactly like #vnm_hostname,
* but additionally allows a label to start with an underscore ("_").
* RFC 2782 introduced the use of underscores as a leading character for
* service and protocol names to reduce accidental clashes,
* and thus we support them as required.
* Note however that this check is stupid
* in that \e all labels are allowed to start with underscores \ldots
*/

Oh, it seems not to be completely correct, unfortunately.  I think
i should stop tracking -d again.

--steffen


Re: CVS commit: src/lib/libc/net

2015-11-02 Thread Steffen Nurpmeso
oops, of course

  ?0[sdaoden@wales]$ git grep IS_ASCII_ master  
   
  master:modules/dns/config.h:#define _IS_ASCII_PRINTABLE(CHAR) ((CHAR) > 0x20 
&& (CHAR) < 0x7F)
  master:modules/dns/config.h:#define _IS_ASCII_ALNUM(CHAR)   
(_IS_ASCII_ALPHA(CHAR) ||_IS_ASCII_DIGIT(CHAR))
  master:modules/dns/config.h:#define _IS_ASCII_ALPHA(CHAR)   (  ((CHAR) >= 
0x41 && (CHAR) <= 0x5A) \
  master:modules/dns/config.h:#define _IS_ASCII_DIGIT(CHAR)   ((CHAR) >= 
0x30 && (CHAR) <= 0x39)

--steffen


Re: CVS commit: src/lib/libc/net

2015-11-02 Thread Erik Fair
So, what did we do by default: allow “_” in hostnames when that’s explicitly 
against standard, or not? I read the patch in the PR and couldn’t make heads or 
tails of it.

Erik 



> On Oct 26, 2015, at 07:48, Christos Zoulas  wrote:
> 
> Module Name:  src
> Committed By: christos
> Date: Mon Oct 26 14:48:04 UTC 2015
> 
> Modified Files:
>   src/lib/libc/net: getaddrinfo.c
> 
> Log Message:
> PR/50367: Stefan Schaeckeler: libc resolver library does not resolve host
> names with underscores ("_"). According to resolv.conf(5) RES_NOCHECKNAME
> is on by default; well, it is and gethostbyname(3) obeys it
> (gethnamaddr.c:maybe_ok), but getaddrinfo(3) up till this commit not.
> XXX: pullup-7, pullup-6
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.109 -r1.110 src/lib/libc/net/getaddrinfo.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 


Re: CVS commit: src/lib/libc/net

2011-12-26 Thread Joerg Sonnenberger
On Mon, Dec 26, 2011 at 05:49:41PM +1100, matthew green wrote:
 
  For completeness, it should be:
  
  .if ${HAVE_GCC:U} == 45  ${MACHINE_CPU} == arm
  COPTS.getaddrinfo.c+=   ${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
  COPTS.gethnameaddr.c+=  ${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
  .endif
 
 why not just have:
 
.if ${HAVE_GCC:U} == 45  ${MACHINE_CPU} == arm  ${ACTIVE_CC} == 
 gcc
 
 and avoid the unusual make pattern and evaluating it twice?

That adds a lot of restrictions on when UNSUPPORT_COMPILER.XXX can be
set. I don't think it's a good idea to do that.

I am consider to provide an alternative version of CWARNFLAGS.${IMPSRC}
though, which includes the active compiler.

Joerg


re: CVS commit: src/lib/libc/net

2011-12-26 Thread matthew green

 On Mon, Dec 26, 2011 at 05:49:41PM +1100, matthew green wrote:
  
   For completeness, it should be:
   
   .if ${HAVE_GCC:U} == 45  ${MACHINE_CPU} == arm
   COPTS.getaddrinfo.c+= ${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
   COPTS.gethnameaddr.c+=${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
   .endif
  
  why not just have:
  
 .if ${HAVE_GCC:U} == 45  ${MACHINE_CPU} == arm  ${ACTIVE_CC} == 
  gcc
  
  and avoid the unusual make pattern and evaluating it twice?
 
 That adds a lot of restrictions on when UNSUPPORT_COMPILER.XXX can be
 set. I don't think it's a good idea to do that.

i don't understand this.  can you explain it further?

 I am consider to provide an alternative version of CWARNFLAGS.${IMPSRC}
 though, which includes the active compiler.


.mrg.


Re: CVS commit: src/lib/libc/net

2011-12-26 Thread Joerg Sonnenberger
On Tue, Dec 27, 2011 at 12:44:10PM +1100, matthew green wrote:
  That adds a lot of restrictions on when UNSUPPORT_COMPILER.XXX can be
  set. I don't think it's a good idea to do that.
 
 i don't understand this.  can you explain it further?

The suggested pattern allows the variable to be set anywhere in the
Makefile (and Makefile.incs that it includes). Using it in .if restricts
that to whatever is set before this line. It also requires that
bsd.own.mk is included at this point.

Joerg


re: CVS commit: src/lib/libc/net

2011-12-25 Thread matthew green

 For completeness, it should be:
 
 .if ${HAVE_GCC:U} == 45  ${MACHINE_CPU} == arm
 COPTS.getaddrinfo.c+= ${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
 COPTS.gethnameaddr.c+=${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
 .endif

why not just have:

   .if ${HAVE_GCC:U} == 45  ${MACHINE_CPU} == arm  ${ACTIVE_CC} == gcc

and avoid the unusual make pattern and evaluating it twice?


.mrg.


Re: CVS commit: src/lib/libc/net

2011-12-24 Thread Joerg Sonnenberger
On Sat, Dec 24, 2011 at 04:59:00AM +, Izumi Tsutsui wrote:
 Log Message:
 Specify -fno-tree-ter to getaddrinfo.c and gethnamaddr.c on arm and gcc45
 for workaround of a possible optimazation bug.

Please make sure this only is applied if the active CC is GCC.

Joerg


Re: CVS commit: src/lib/libc/net

2011-12-24 Thread Izumi Tsutsui
  Log Message:
  Specify -fno-tree-ter to getaddrinfo.c and gethnamaddr.c on arm and gcc45
  for workaround of a possible optimazation bug.
 
 Please make sure this only is applied if the active CC is GCC.

Isn't this enough?

---
.if defined(HAVE_GCC)  ${HAVE_GCC} == 45  ${MACHINE_CPU} == arm   
COPTS.getaddrinfo.c+=   -fno-tree-ter
COPTS.gethnamaddr.c+=   -fno-tree-ter
.endif

---
Izumi Tsutsui


Re: CVS commit: src/lib/libc/net

2011-12-24 Thread Izumi Tsutsui
 On Sat, Dec 24, 2011 at 10:17:37PM +0900, Izumi Tsutsui wrote:
Log Message:
Specify -fno-tree-ter to getaddrinfo.c and gethnamaddr.c on arm and 
gcc45
for workaround of a possible optimazation bug.
   
   Please make sure this only is applied if the active CC is GCC.
  
  Isn't this enough?
  
  ---
  .if defined(HAVE_GCC)  ${HAVE_GCC} == 45  ${MACHINE_CPU} == arm   
  COPTS.getaddrinfo.c+=   -fno-tree-ter
  COPTS.gethnamaddr.c+=   -fno-tree-ter
  .endif
 
 No, this only checks that HAVE_GCC is supported. HAVE_GCC, HAVE_LLVM and
 HAVE_PCC are non-exclusive with a fallback order.

So what's the proper test?

I don't see any proper examples:
bin/csh/Makefile
games/phantasia/Makefile
lib/libedit/Makefile
sbin/fsdb/Makefile
etc.

Could you please fix them?

---
Izumi Tsutsui


Re: CVS commit: src/lib/libc/net

2011-12-24 Thread Joerg Sonnenberger
On Sun, Dec 25, 2011 at 09:54:37AM +0900, Izumi Tsutsui wrote:
  On Sat, Dec 24, 2011 at 10:17:37PM +0900, Izumi Tsutsui wrote:
 Log Message:
 Specify -fno-tree-ter to getaddrinfo.c and gethnamaddr.c on arm and 
 gcc45
 for workaround of a possible optimazation bug.

Please make sure this only is applied if the active CC is GCC.
   
   Isn't this enough?
   
   ---
   .if defined(HAVE_GCC)  ${HAVE_GCC} == 45  ${MACHINE_CPU} == arm   
   COPTS.getaddrinfo.c+= -fno-tree-ter
   COPTS.gethnamaddr.c+= -fno-tree-ter
   .endif
  
  No, this only checks that HAVE_GCC is supported. HAVE_GCC, HAVE_LLVM and
  HAVE_PCC are non-exclusive with a fallback order.
 
 So what's the proper test?
 
 I don't see any proper examples:
 bin/csh/Makefile
 games/phantasia/Makefile
 lib/libedit/Makefile
 sbin/fsdb/Makefile
 etc.
 
 Could you please fix them?

I will fix them at some point. I don't care too much about those, since
they apply to platforms that LLVM doesn't support (and isn't likely to
support soon) or they simply use standard options. -fno-tree-ter doesn't
qualify for that though.

For completeness, it should be:

.if ${HAVE_GCC:U} == 45  ${MACHINE_CPU} == arm
COPTS.getaddrinfo.c+=   ${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
COPTS.gethnameaddr.c+=  ${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
.endif

Joerg


Re: CVS commit: src/lib/libc/net

2011-12-24 Thread Izumi Tsutsui
 On Sun, Dec 25, 2011 at 09:54:37AM +0900, Izumi Tsutsui wrote:
   On Sat, Dec 24, 2011 at 10:17:37PM +0900, Izumi Tsutsui wrote:
  Log Message:
  Specify -fno-tree-ter to getaddrinfo.c and gethnamaddr.c on arm 
  and gcc45
  for workaround of a possible optimazation bug.
 
 Please make sure this only is applied if the active CC is GCC.

Isn't this enough?

---
.if defined(HAVE_GCC)  ${HAVE_GCC} == 45  ${MACHINE_CPU} == arm 
  
COPTS.getaddrinfo.c+=   -fno-tree-ter
COPTS.gethnamaddr.c+=   -fno-tree-ter
.endif
   
   No, this only checks that HAVE_GCC is supported. HAVE_GCC, HAVE_LLVM and
   HAVE_PCC are non-exclusive with a fallback order.
  
  So what's the proper test?
  
  I don't see any proper examples:
  bin/csh/Makefile
  games/phantasia/Makefile
  lib/libedit/Makefile
  sbin/fsdb/Makefile
  etc.
  
  Could you please fix them?
 
 I will fix them at some point. I don't care too much about those, since
 they apply to platforms that LLVM doesn't support (and isn't likely to
 support soon) or they simply use standard options. -fno-tree-ter doesn't
 qualify for that though.
 
 For completeness, it should be:
 
 .if ${HAVE_GCC:U} == 45  ${MACHINE_CPU} == arm
 COPTS.getaddrinfo.c+= ${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
 COPTS.gethnameaddr.c+=${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
 .endif

Please commit.  I can't test LLVM right now.

---
Izumi Tsutsui


Re: CVS commit: src/lib/libc/net

2011-12-24 Thread Joerg Sonnenberger
On Sun, Dec 25, 2011 at 10:20:35AM +0900, Izumi Tsutsui wrote:
  On Sun, Dec 25, 2011 at 09:54:37AM +0900, Izumi Tsutsui wrote:
On Sat, Dec 24, 2011 at 10:17:37PM +0900, Izumi Tsutsui wrote:
   Log Message:
   Specify -fno-tree-ter to getaddrinfo.c and gethnamaddr.c on arm 
   and gcc45
   for workaround of a possible optimazation bug.
  
  Please make sure this only is applied if the active CC is GCC.
 
 Isn't this enough?
 
 ---
 .if defined(HAVE_GCC)  ${HAVE_GCC} == 45  ${MACHINE_CPU} == 
 arm   
 COPTS.getaddrinfo.c+= -fno-tree-ter
 COPTS.gethnamaddr.c+= -fno-tree-ter
 .endif

No, this only checks that HAVE_GCC is supported. HAVE_GCC, HAVE_LLVM and
HAVE_PCC are non-exclusive with a fallback order.
   
   So what's the proper test?
   
   I don't see any proper examples:
   bin/csh/Makefile
   games/phantasia/Makefile
   lib/libedit/Makefile
   sbin/fsdb/Makefile
   etc.
   
   Could you please fix them?
  
  I will fix them at some point. I don't care too much about those, since
  they apply to platforms that LLVM doesn't support (and isn't likely to
  support soon) or they simply use standard options. -fno-tree-ter doesn't
  qualify for that though.
  
  For completeness, it should be:
  
  .if ${HAVE_GCC:U} == 45  ${MACHINE_CPU} == arm
  COPTS.getaddrinfo.c+=   ${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
  COPTS.gethnameaddr.c+=  ${${ACTIVE_CC} == gcc :? -fno-tree-ter :}
  .endif
 
 Please commit.  I can't test LLVM right now.

The above won't break with LLVM, but please make sure that it does what
you want.

Joerg


Re: CVS commit: src/lib/libc/net

2010-12-07 Thread Christos Zoulas
In article 20101208020539.c6bd817...@cvs.netbsd.org,
Joerg Sonnenberger source-changes-d@NetBSD.org wrote:
-=-=-=-=-=-

Module Name:   src
Committed By:  joerg
Date:  Wed Dec  8 02:05:39 UTC 2010

Modified Files:
   src/lib/libc/net: nslexer.l

Log Message:
input() is not used, so don't provide it.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/net/nslexer.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


-=-=-=-=-=-

Modified files:

Index: src/lib/libc/net/nslexer.l
diff -u src/lib/libc/net/nslexer.l:1.9 src/lib/libc/net/nslexer.l:1.10
--- src/lib/libc/net/nslexer.l:1.9 Thu Oct 29 14:49:03 2009
+++ src/lib/libc/net/nslexer.l Wed Dec  8 02:05:39 2010
@@ -1,5 +1,5 @@
 %{
-/*$NetBSD: nslexer.l,v 1.9 2009/10/29 14:49:03 christos Exp $ */
+/*$NetBSD: nslexer.l,v 1.10 2010/12/08 02:05:39 joerg Exp $   */
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: nslexer.l,v 1.9 2009/10/29 14:49:03 christos Exp $);
+__RCSID($NetBSD: nslexer.l,v 1.10 2010/12/08 02:05:39 joerg Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -44,6 +44,8 @@
 
 #include nsparser.h
 
+#define   YY_NO_INPUT
+
 %}
 
 %option yylineno nounput

Probably better to %option noinput

christos



CVS commit: src/lib/libc/net

2010-01-29 Thread Ignatios Souvatzis
Module Name:src
Committed By:   is
Date:   Fri Jan 29 22:26:48 UTC 2010

Modified Files:
src/lib/libc/net: getnameinfo.c

Log Message:
Print AppleTalk phase 2 range, too, if available.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/lib/libc/net/getnameinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/lib/libc/net

2009-10-02 Thread Christoph Egger
Thomas Klausner wrote:
 Module Name:  src
 Committed By: wiz
 Date: Fri Oct  2 07:41:08 UTC 2009
 
 Modified Files:
   src/lib/libc/net: getaddrinfo.3 getaddrinfo.c gethnamaddr.c
 
 Log Message:
 Revert a - an changes: Adding an 'n' follows pronunciation, not writing.

Thanks. I was about doing that but you beat me.

Christoph



Re: CVS commit: src/lib/libc/net

2009-10-02 Thread Soren Jacobsen

On Oct 1, 2009, at 11:49 PM, Christoph Egger wrote:


Index: src/lib/libc/net/getaddrinfo.3
diff -u src/lib/libc/net/getaddrinfo.3:1.47 src/lib/libc/net/ 
getaddrinfo.3:1.48

--- src/lib/libc/net/getaddrinfo.3:1.47 Fri Oct  2 02:45:29 2009
+++ src/lib/libc/net/getaddrinfo.3  Fri Oct  2 06:49:23 2009
@@ -260,7 +260,7 @@
interface
.Dc .
.Pp
-The current implementation assumes a one-to-one relationship between
+The current implementation assumes an one-to-one relationship between


This is wrong.


Index: src/lib/libc/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.93 src/lib/libc/net/ 
getaddrinfo.c:1.94

--- src/lib/libc/net/getaddrinfo.c:1.93 Fri Oct  2 02:45:29 2009
+++ src/lib/libc/net/getaddrinfo.c  Fri Oct  2 06:49:23 2009
@@ -1027,7 +1027,7 @@

if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) {
/*
-* We currently assume a one-to-one mapping between links
+* We currently assume an one-to-one mapping between links


This is wrong.


@@ -1799,7 +1799,7 @@
trailing_dot++;

/*
-* if there aren't any dots, it could be a user-level alias
+* if there aren't any dots, it could be an user-level alias


This is wrong.


Index: src/lib/libc/net/gethnamaddr.c
diff -u src/lib/libc/net/gethnamaddr.c:1.73 src/lib/libc/net/ 
gethnamaddr.c:1.74

--- src/lib/libc/net/gethnamaddr.c:1.73 Sat Jan 27 22:27:35 2007
+++ src/lib/libc/net/gethnamaddr.c  Fri Oct  2 06:49:23 2009
@@ -573,7 +573,7 @@
host.h_length = size;

/*
-* if there aren't any dots, it could be a user-level alias.
+* if there aren't any dots, it could be an user-level alias.


This is wrong.