diff options
author | sperreault <sperreault@cvs.openbsd.org> | 2014-04-28 21:39:00 +0000 |
---|---|---|
committer | sperreault <sperreault@cvs.openbsd.org> | 2014-04-28 21:39:00 +0000 |
commit | 69373aca66169526f7c1d2e37f012a5c0e3abaf7 (patch) | |
tree | 85d52f2d236a389673e08a9b857f081af54e7d19 /lib/libc/net | |
parent | 1c6bc079ab33d7b342870c7cdf6a9e344ff5936f (diff) |
Implement AI_ADDRCONFIG
This is a getaddrinfo() flag that is defined thusly in RFC 3493:
If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be
returned only if an IPv4 address is configured on the local system,
and IPv6 addresses shall be returned only if an IPv6 address is
configured on the local system. The loopback address is not
considered for this case as valid as a configured address.
For example, when using the DNS, a query for AAAA records should
occur only if the node has at least one IPv6 address configured
(other than IPv6 loopback) and a query for A records should occur
only if the node has at least one IPv4 address configured (other
than the IPv4 loopback).
The flag is set by default when hints is NULL.
ok Eric Faurot, Jason McIntyre
Diffstat (limited to 'lib/libc/net')
-rw-r--r-- | lib/libc/net/getaddrinfo.3 | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/libc/net/getaddrinfo.3 b/lib/libc/net/getaddrinfo.3 index db4417ab358..33270dbdf67 100644 --- a/lib/libc/net/getaddrinfo.3 +++ b/lib/libc/net/getaddrinfo.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getaddrinfo.3,v 1.54 2014/01/21 03:15:45 schwarze Exp $ +.\" $OpenBSD: getaddrinfo.3,v 1.55 2014/04/28 21:38:59 sperreault Exp $ .\" $KAME: getaddrinfo.3,v 1.36 2005/01/05 03:23:05 itojun Exp $ .\" .\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -16,7 +16,7 @@ .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 21 2014 $ +.Dd $Mdocdate: April 28 2014 $ .Dt GETADDRINFO 3 .Os .Sh NAME @@ -120,6 +120,14 @@ is formed by .Tn OR Ns 'ing the following values: .Bl -tag -width "AI_CANONNAMEXX" +.It Dv AI_ADDRCONFIG +If the +.Dv AI_ADDRCONFIG +bit is set, IPv4 addresses will be returned only if an IPv4 address is +configured on an interface, and IPv6 addresses will be returned only if an IPv6 +address is configured on an interface. +Addresses on a loopback interface and link-local IPv6 addresses are not +considered valid as configured addresses. .It Dv AI_CANONNAME If the .Dv AI_CANONNAME @@ -219,7 +227,10 @@ behaves as if the caller provided a with .Fa ai_family set to -.Dv PF_UNSPEC +.Dv PF_UNSPEC , +.Fa ai_flags +set to +.Dv AI_ADDRCONFIG , and all other elements set to zero or .Dv NULL . .Pp |