From bdad2fefb206d9727d4a3254f7883b8455452d89 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 4 Jun 2014 02:24:38 -0400 Subject: add support for ipv6 scope_id to getaddrinfo and getnameinfo for all address types, a scope_id specified as a decimal value is accepted. for addresses with link-local scope, a string containing the interface name is also accepted. some changes are made to error handling to avoid unwanted fallbacks in the case where the scope_id is invalid: if an earlier name lookup backend fails with an error rather than simply "0 results", this failure now suppresses any later attempts with other backends. in getnameinfo, a light "itoa" type function is added for generating decimal scope_id results, and decimal port strings for services are also generated using this function now so as not to pull in the dependency on snprintf. in netdb.h, a definition for the NI_NUMERICSCOPE flag is added. this is required by POSIX (it was previously missing) and needed to allow callers to suppress interface-name lookups. --- include/netdb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/netdb.h b/include/netdb.h index dfc70e2b..703a4b26 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -41,7 +41,7 @@ struct addrinfo #define NI_NOFQDN 0x04 #define NI_NAMEREQD 0x08 #define NI_DGRAM 0x10 -/*#define NI_NUMERICSCOPE */ +#define NI_NUMERICSCOPE 0x100 #define EAI_BADFLAGS -1 #define EAI_NONAME -2 -- cgit v1.2.1