diff options
author | sperreault <> | 2014-04-28 21:38:59 +0000 |
---|---|---|
committer | sperreault <> | 2014-04-28 21:38:59 +0000 |
commit | b4455c6b8c8da6f0da39b8811736a58b7d363f47 (patch) | |
tree | 864b0df12c951a644c48541835f731e10d5ca360 | |
parent | 5c80b04ad533e531e552e7e775b6df48dd1fcecc (diff) | |
download | openbsd-b4455c6b8c8da6f0da39b8811736a58b7d363f47.tar.gz openbsd-b4455c6b8c8da6f0da39b8811736a58b7d363f47.tar.bz2 openbsd-b4455c6b8c8da6f0da39b8811736a58b7d363f47.zip |
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
-rw-r--r-- | src/lib/libc/net/getaddrinfo.3 | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/lib/libc/net/getaddrinfo.3 b/src/lib/libc/net/getaddrinfo.3 index db4417ab35..33270dbdf6 100644 --- a/src/lib/libc/net/getaddrinfo.3 +++ b/src/lib/libc/net/getaddrinfo.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: getaddrinfo.3,v 1.54 2014/01/21 03:15:45 schwarze Exp $ | 1 | .\" $OpenBSD: getaddrinfo.3,v 1.55 2014/04/28 21:38:59 sperreault 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 | .\" | 3 | .\" |
4 | .\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") | 4 | .\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") |
@@ -16,7 +16,7 @@ | |||
16 | .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | 16 | .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
17 | .\" PERFORMANCE OF THIS SOFTWARE. | 17 | .\" PERFORMANCE OF THIS SOFTWARE. |
18 | .\" | 18 | .\" |
19 | .Dd $Mdocdate: January 21 2014 $ | 19 | .Dd $Mdocdate: April 28 2014 $ |
20 | .Dt GETADDRINFO 3 | 20 | .Dt GETADDRINFO 3 |
21 | .Os | 21 | .Os |
22 | .Sh NAME | 22 | .Sh NAME |
@@ -120,6 +120,14 @@ is formed by | |||
120 | .Tn OR Ns 'ing | 120 | .Tn OR Ns 'ing |
121 | the following values: | 121 | the following values: |
122 | .Bl -tag -width "AI_CANONNAMEXX" | 122 | .Bl -tag -width "AI_CANONNAMEXX" |
123 | .It Dv AI_ADDRCONFIG | ||
124 | If the | ||
125 | .Dv AI_ADDRCONFIG | ||
126 | bit is set, IPv4 addresses will be returned only if an IPv4 address is | ||
127 | configured on an interface, and IPv6 addresses will be returned only if an IPv6 | ||
128 | address is configured on an interface. | ||
129 | Addresses on a loopback interface and link-local IPv6 addresses are not | ||
130 | considered valid as configured addresses. | ||
123 | .It Dv AI_CANONNAME | 131 | .It Dv AI_CANONNAME |
124 | If the | 132 | If the |
125 | .Dv AI_CANONNAME | 133 | .Dv AI_CANONNAME |
@@ -219,7 +227,10 @@ behaves as if the caller provided a | |||
219 | with | 227 | with |
220 | .Fa ai_family | 228 | .Fa ai_family |
221 | set to | 229 | set to |
222 | .Dv PF_UNSPEC | 230 | .Dv PF_UNSPEC , |
231 | .Fa ai_flags | ||
232 | set to | ||
233 | .Dv AI_ADDRCONFIG , | ||
223 | and all other elements set to zero or | 234 | and all other elements set to zero or |
224 | .Dv NULL . | 235 | .Dv NULL . |
225 | .Pp | 236 | .Pp |