Fri Oct 2 06:49:24 2009 UTC ()
fix grammar: a -> an


(cegger)
diff -r1.47 -r1.48 src/lib/libc/net/getaddrinfo.3
diff -r1.93 -r1.94 src/lib/libc/net/getaddrinfo.c
diff -r1.73 -r1.74 src/lib/libc/net/gethnamaddr.c
diff -r1.22 -r1.23 src/lib/libc/net/resolver.3

cvs diff -r1.47 -r1.48 src/lib/libc/net/getaddrinfo.3 (expand / switch to unified diff)

--- src/lib/libc/net/getaddrinfo.3 2009/10/02 02:45:29 1.47
+++ src/lib/libc/net/getaddrinfo.3 2009/10/02 06:49:23 1.48
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: getaddrinfo.3,v 1.47 2009/10/02 02:45:29 tsarna Exp $ 1.\" $NetBSD: getaddrinfo.3,v 1.48 2009/10/02 06:49:23 cegger Exp $
2.\" $KAME: getaddrinfo.3,v 1.36 2005/01/05 03:23:05 itojun Exp $ 2.\" $KAME: getaddrinfo.3,v 1.36 2005/01/05 03:23:05 itojun Exp $
3.\" $OpenBSD: getaddrinfo.3,v 1.35 2004/12/21 03:40:31 jaredy Exp $ 3.\" $OpenBSD: getaddrinfo.3,v 1.35 2004/12/21 03:40:31 jaredy Exp $
4.\" 4.\"
5.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") 5.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
6.\" Copyright (C) 2000, 2001 Internet Software Consortium. 6.\" Copyright (C) 2000, 2001 Internet Software Consortium.
7.\" 7.\"
8.\" Permission to use, copy, modify, and distribute this software for any 8.\" Permission to use, copy, modify, and distribute this software for any
9.\" purpose with or without fee is hereby granted, provided that the above 9.\" purpose with or without fee is hereby granted, provided that the above
10.\" copyright notice and this permission notice appear in all copies. 10.\" copyright notice and this permission notice appear in all copies.
11.\" 11.\"
12.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 12.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
13.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 13.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14.\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 14.\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
@@ -250,47 +250,47 @@ with the link @@ -250,47 +250,47 @@ with the link
250such as 250such as
251.Li ne0 251.Li ne0
252.Pc . 252.Pc .
253An example is 253An example is
254.Dq Li fe80::1%ne0 , 254.Dq Li fe80::1%ne0 ,
255which means 255which means
256.Do 256.Do
257.Li fe80::1 257.Li fe80::1
258on the link associated with the 258on the link associated with the
259.Li ne0 259.Li ne0
260interface 260interface
261.Dc . 261.Dc .
262.Pp 262.Pp
263The current implementation assumes a one-to-one relationship between 263The current implementation assumes an one-to-one relationship between
264the interface and link, which is not necessarily true from the specification. 264the interface and link, which is not necessarily true from the specification.
265.Pp 265.Pp
266All of the information returned by 266All of the information returned by
267.Fn getaddrinfo 267.Fn getaddrinfo
268is dynamically allocated: the 268is dynamically allocated: the
269.Li addrinfo 269.Li addrinfo
270structures themselves as well as the socket address structures and 270structures themselves as well as the socket address structures and
271the canonical host name strings included in the 271the canonical host name strings included in the
272.Li addrinfo 272.Li addrinfo
273structures. 273structures.
274.Pp 274.Pp
275Memory allocated for the dynamically allocated structures created by 275Memory allocated for the dynamically allocated structures created by
276a successful call to 276a successful call to
277.Fn getaddrinfo 277.Fn getaddrinfo
278is released by the 278is released by the
279.Fn freeaddrinfo 279.Fn freeaddrinfo
280function. 280function.
281The 281The
282.Fa ai 282.Fa ai
283pointer should be a 283pointer should be an
284.Li addrinfo 284.Li addrinfo
285structure created by a call to 285structure created by a call to
286.Fn getaddrinfo 286.Fn getaddrinfo
287or 287or
288.Fn allocaddrinfo . 288.Fn allocaddrinfo .
289The 289The
290.Fn allocaddrinfo 290.Fn allocaddrinfo
291function is intended primarily for authors of 291function is intended primarily for authors of
292.Xr nsdispatch 3 292.Xr nsdispatch 3
293plugins implementing 293plugins implementing
294.Fn getaddrinfo 294.Fn getaddrinfo
295backends. 295backends.
296.Fn allocaddrinfo 296.Fn allocaddrinfo

cvs diff -r1.93 -r1.94 src/lib/libc/net/getaddrinfo.c (expand / switch to unified diff)

--- src/lib/libc/net/getaddrinfo.c 2009/10/02 02:45:29 1.93
+++ src/lib/libc/net/getaddrinfo.c 2009/10/02 06:49:23 1.94
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: getaddrinfo.c,v 1.93 2009/10/02 02:45:29 tsarna Exp $ */ 1/* $NetBSD: getaddrinfo.c,v 1.94 2009/10/02 06:49:23 cegger Exp $ */
2/* $KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $ */ 2/* $KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $ */
3 3
4/* 4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -45,27 +45,27 @@ @@ -45,27 +45,27 @@
45 * Note: 45 * Note:
46 * - The code filters out AFs that are not supported by the kernel, 46 * - The code filters out AFs that are not supported by the kernel,
47 * when globbing NULL hostname (to loopback, or wildcard). Is it the right 47 * when globbing NULL hostname (to loopback, or wildcard). Is it the right
48 * thing to do? What is the relationship with post-RFC2553 AI_ADDRCONFIG 48 * thing to do? What is the relationship with post-RFC2553 AI_ADDRCONFIG
49 * in ai_flags? 49 * in ai_flags?
50 * - (post-2553) semantics of AI_ADDRCONFIG itself is too vague. 50 * - (post-2553) semantics of AI_ADDRCONFIG itself is too vague.
51 * (1) what should we do against numeric hostname (2) what should we do 51 * (1) what should we do against numeric hostname (2) what should we do
52 * against NULL hostname (3) what is AI_ADDRCONFIG itself. AF not ready? 52 * against NULL hostname (3) what is AI_ADDRCONFIG itself. AF not ready?
53 * non-loopback address configured? global address configured? 53 * non-loopback address configured? global address configured?
54 */ 54 */
55 55
56#include <sys/cdefs.h> 56#include <sys/cdefs.h>
57#if defined(LIBC_SCCS) && !defined(lint) 57#if defined(LIBC_SCCS) && !defined(lint)
58__RCSID("$NetBSD: getaddrinfo.c,v 1.93 2009/10/02 02:45:29 tsarna Exp $"); 58__RCSID("$NetBSD: getaddrinfo.c,v 1.94 2009/10/02 06:49:23 cegger Exp $");
59#endif /* LIBC_SCCS and not lint */ 59#endif /* LIBC_SCCS and not lint */
60 60
61#include "namespace.h" 61#include "namespace.h"
62#include <sys/types.h> 62#include <sys/types.h>
63#include <sys/param.h> 63#include <sys/param.h>
64#include <sys/socket.h> 64#include <sys/socket.h>
65#include <net/if.h> 65#include <net/if.h>
66#include <netinet/in.h> 66#include <netinet/in.h>
67#include <arpa/inet.h> 67#include <arpa/inet.h>
68#include <arpa/nameser.h> 68#include <arpa/nameser.h>
69#include <assert.h> 69#include <assert.h>
70#include <ctype.h> 70#include <ctype.h>
71#include <errno.h> 71#include <errno.h>
@@ -1017,27 +1017,27 @@ ip6_str2scopeid(char *scope, struct sock @@ -1017,27 +1017,27 @@ ip6_str2scopeid(char *scope, struct sock
1017 1017
1018 _DIAGASSERT(scope != NULL); 1018 _DIAGASSERT(scope != NULL);
1019 _DIAGASSERT(sin6 != NULL); 1019 _DIAGASSERT(sin6 != NULL);
1020 _DIAGASSERT(scopeid != NULL); 1020 _DIAGASSERT(scopeid != NULL);
1021 1021
1022 a6 = &sin6->sin6_addr; 1022 a6 = &sin6->sin6_addr;
1023 1023
1024 /* empty scopeid portion is invalid */ 1024 /* empty scopeid portion is invalid */
1025 if (*scope == '\0') 1025 if (*scope == '\0')
1026 return -1; 1026 return -1;
1027 1027
1028 if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) { 1028 if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) {
1029 /* 1029 /*
1030 * We currently assume a one-to-one mapping between links 1030 * We currently assume an one-to-one mapping between links
1031 * and interfaces, so we simply use interface indices for 1031 * and interfaces, so we simply use interface indices for
1032 * like-local scopes. 1032 * like-local scopes.
1033 */ 1033 */
1034 *scopeid = if_nametoindex(scope); 1034 *scopeid = if_nametoindex(scope);
1035 if (*scopeid == 0) 1035 if (*scopeid == 0)
1036 goto trynumeric; 1036 goto trynumeric;
1037 return 0; 1037 return 0;
1038 } 1038 }
1039 1039
1040 /* still unclear about literal, allow numeric only - placeholder */ 1040 /* still unclear about literal, allow numeric only - placeholder */
1041 if (IN6_IS_ADDR_SITELOCAL(a6) || IN6_IS_ADDR_MC_SITELOCAL(a6)) 1041 if (IN6_IS_ADDR_SITELOCAL(a6) || IN6_IS_ADDR_MC_SITELOCAL(a6))
1042 goto trynumeric; 1042 goto trynumeric;
1043 if (IN6_IS_ADDR_MC_ORGLOCAL(a6)) 1043 if (IN6_IS_ADDR_MC_ORGLOCAL(a6))
@@ -1789,27 +1789,27 @@ res_searchN(const char *name, struct res @@ -1789,27 +1789,27 @@ res_searchN(const char *name, struct res
1789 1789
1790 hp = (HEADER *)(void *)target->answer; /*XXX*/ 1790 hp = (HEADER *)(void *)target->answer; /*XXX*/
1791 1791
1792 errno = 0; 1792 errno = 0;
1793 h_errno = HOST_NOT_FOUND; /* default, if we never query */ 1793 h_errno = HOST_NOT_FOUND; /* default, if we never query */
1794 dots = 0; 1794 dots = 0;
1795 for (cp = name; *cp; cp++) 1795 for (cp = name; *cp; cp++)
1796 dots += (*cp == '.'); 1796 dots += (*cp == '.');
1797 trailing_dot = 0; 1797 trailing_dot = 0;
1798 if (cp > name && *--cp == '.') 1798 if (cp > name && *--cp == '.')
1799 trailing_dot++; 1799 trailing_dot++;
1800 1800
1801 /* 1801 /*
1802 * if there aren't any dots, it could be a user-level alias 1802 * if there aren't any dots, it could be an user-level alias
1803 */ 1803 */
1804 if (!dots && (cp = __hostalias(name)) != NULL) { 1804 if (!dots && (cp = __hostalias(name)) != NULL) {
1805 ret = res_queryN(cp, target, res); 1805 ret = res_queryN(cp, target, res);
1806 return ret; 1806 return ret;
1807 } 1807 }
1808 1808
1809 /* 1809 /*
1810 * If there are dots in the name already, let's just give it a try 1810 * If there are dots in the name already, let's just give it a try
1811 * 'as is'. The threshold can be set with the "ndots" option. 1811 * 'as is'. The threshold can be set with the "ndots" option.
1812 */ 1812 */
1813 saved_herrno = -1; 1813 saved_herrno = -1;
1814 if (dots >= res->ndots) { 1814 if (dots >= res->ndots) {
1815 ret = res_querydomainN(name, NULL, target, res); 1815 ret = res_querydomainN(name, NULL, target, res);

cvs diff -r1.73 -r1.74 src/lib/libc/net/gethnamaddr.c (expand / switch to unified diff)

--- src/lib/libc/net/gethnamaddr.c 2007/01/27 22:27:35 1.73
+++ src/lib/libc/net/gethnamaddr.c 2009/10/02 06:49:23 1.74
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: gethnamaddr.c,v 1.73 2007/01/27 22:27:35 christos Exp $ */ 1/* $NetBSD: gethnamaddr.c,v 1.74 2009/10/02 06:49:23 cegger Exp $ */
2 2
3/* 3/*
4 * ++Copyright++ 1985, 1988, 1993 4 * ++Copyright++ 1985, 1988, 1993
5 * - 5 * -
6 * Copyright (c) 1985, 1988, 1993 6 * Copyright (c) 1985, 1988, 1993
7 * The Regents of the University of California. All rights reserved. 7 * The Regents of the University of California. All rights reserved.
8 *  8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -47,27 +47,27 @@ @@ -47,27 +47,27 @@
47 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 47 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
48 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 48 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
49 * SOFTWARE. 49 * SOFTWARE.
50 * - 50 * -
51 * --Copyright-- 51 * --Copyright--
52 */ 52 */
53 53
54#include <sys/cdefs.h> 54#include <sys/cdefs.h>
55#if defined(LIBC_SCCS) && !defined(lint) 55#if defined(LIBC_SCCS) && !defined(lint)
56#if 0 56#if 0
57static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; 57static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
58static char rcsid[] = "Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp "; 58static char rcsid[] = "Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp ";
59#else 59#else
60__RCSID("$NetBSD: gethnamaddr.c,v 1.73 2007/01/27 22:27:35 christos Exp $"); 60__RCSID("$NetBSD: gethnamaddr.c,v 1.74 2009/10/02 06:49:23 cegger Exp $");
61#endif 61#endif
62#endif /* LIBC_SCCS and not lint */ 62#endif /* LIBC_SCCS and not lint */
63 63
64#if defined(_LIBC) 64#if defined(_LIBC)
65#include "namespace.h" 65#include "namespace.h"
66#endif 66#endif
67#include <sys/param.h> 67#include <sys/param.h>
68#include <sys/socket.h> 68#include <sys/socket.h>
69#include <netinet/in.h> 69#include <netinet/in.h>
70#include <arpa/inet.h> 70#include <arpa/inet.h>
71#include <arpa/nameser.h> 71#include <arpa/nameser.h>
72 72
73#include <assert.h> 73#include <assert.h>
@@ -563,27 +563,27 @@ gethostbyname_internal(const char *name, @@ -563,27 +563,27 @@ gethostbyname_internal(const char *name,
563 case AF_INET6: 563 case AF_INET6:
564 size = IN6ADDRSZ; 564 size = IN6ADDRSZ;
565 break; 565 break;
566 default: 566 default:
567 h_errno = NETDB_INTERNAL; 567 h_errno = NETDB_INTERNAL;
568 errno = EAFNOSUPPORT; 568 errno = EAFNOSUPPORT;
569 return NULL; 569 return NULL;
570 } 570 }
571 571
572 host.h_addrtype = af; 572 host.h_addrtype = af;
573 host.h_length = size; 573 host.h_length = size;
574 574
575 /* 575 /*
576 * if there aren't any dots, it could be a user-level alias. 576 * if there aren't any dots, it could be an user-level alias.
577 * this is also done in res_nquery() since we are not the only 577 * this is also done in res_nquery() since we are not the only
578 * function that looks up host names. 578 * function that looks up host names.
579 */ 579 */
580 if (!strchr(name, '.') && (cp = __hostalias(name))) 580 if (!strchr(name, '.') && (cp = __hostalias(name)))
581 name = cp; 581 name = cp;
582 582
583 /* 583 /*
584 * disallow names consisting only of digits/dots, unless 584 * disallow names consisting only of digits/dots, unless
585 * they end in a dot. 585 * they end in a dot.
586 */ 586 */
587 if (isdigit((u_char) name[0])) 587 if (isdigit((u_char) name[0]))
588 for (cp = name;; ++cp) { 588 for (cp = name;; ++cp) {
589 if (!*cp) { 589 if (!*cp) {

cvs diff -r1.22 -r1.23 src/lib/libc/net/resolver.3 (expand / switch to unified diff)

--- src/lib/libc/net/resolver.3 2009/06/08 16:55:30 1.22
+++ src/lib/libc/net/resolver.3 2009/10/02 06:49:23 1.23
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: resolver.3,v 1.22 2009/06/08 16:55:30 christos Exp $ 1.\" $NetBSD: resolver.3,v 1.23 2009/10/02 06:49:23 cegger Exp $
2.\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") 2.\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
3.\" 3.\"
4.\" Permission to use, copy, modify, and distribute this software for any 4.\" Permission to use, copy, modify, and distribute this software for any
5.\" purpose with or without fee is hereby granted, provided that the above 5.\" purpose with or without fee is hereby granted, provided that the above
6.\" copyright notice and this permission notice appear in all copies. 6.\" copyright notice and this permission notice appear in all copies.
7.\" 7.\"
8.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES 8.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
9.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR 10.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
11.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
14.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -307,27 +307,27 @@ This options causes the @@ -307,27 +307,27 @@ This options causes the
307.Fn res_send 307.Fn res_send
308to rotate the list of nameservers in 308to rotate the list of nameservers in
309.Fa statp->nsaddr_list 309.Fa statp->nsaddr_list
310/ 310/
311.Fa _res.nsaddr_list . 311.Fa _res.nsaddr_list .
312.It Dv RES_KEEPTSIG 312.It Dv RES_KEEPTSIG
313This option causes 313This option causes
314.Fn res_nsendsigned 314.Fn res_nsendsigned
315to leave the message unchanged after TSIG verification; otherwise the TSIG 315to leave the message unchanged after TSIG verification; otherwise the TSIG
316record would be removed and the header updated. 316record would be removed and the header updated.
317.It Dv RES_NOTLDQUERY 317.It Dv RES_NOTLDQUERY
318This option causes 318This option causes
319.Fn res_nsearch 319.Fn res_nsearch
320to not attempt to resolve a unqualified name as if it were a top level 320to not attempt to resolve an unqualified name as if it were a top level
321domain (TLD). 321domain (TLD).
322This option can cause problems if the site has "localhost" as a TLD rather 322This option can cause problems if the site has "localhost" as a TLD rather
323than having localhost on one or more elements of the search list. 323than having localhost on one or more elements of the search list.
324This option has no effect if neither 324This option has no effect if neither
325.Dv RES_DEFNAMES 325.Dv RES_DEFNAMES
326or 326or
327.Dv RES_DNSRCH 327.Dv RES_DNSRCH
328is set. 328is set.
329.El 329.El
330.Pp 330.Pp
331The 331The
332.Fn res_ninit 332.Fn res_ninit
333/ 333/