Browse Source

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
OPENBSD_5_6
sperreault 10 years ago
parent
commit
80275baf44
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      src/include/netdb.h

+ 4
- 2
src/include/netdb.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: netdb.h,v 1.31 2012/09/15 00:47:08 guenther Exp $ */
/* $OpenBSD: netdb.h,v 1.32 2014/04/28 21:38:59 sperreault Exp $ */
/*
* ++Copyright++ 1980, 1983, 1988, 1993
@ -167,9 +167,11 @@ extern int h_errno;
#define AI_EXT 8 /* enable non-portable extensions */
#define AI_NUMERICSERV 16 /* don't ever try servname lookup */
#define AI_FQDN 32 /* return the FQDN that was resolved */
#define AI_ADDRCONFIG 64 /* return configured address families only */
/* valid flags for addrinfo */
#define AI_MASK \
(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_FQDN)
(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_FQDN | \
AI_ADDRCONFIG)
#define NI_NUMERICHOST 1 /* return the host address, not the name */
#define NI_NUMERICSERV 2 /* return the service address, not the name */


Loading…
Cancel
Save