Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for AI_NUMERICSERV in getaddrinfo emulation
4 changes: 3 additions & 1 deletion Modules/addrinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
#undef AI_PASSIVE
#undef AI_CANONNAME
#undef AI_NUMERICHOST
#undef AI_NUMERICSERV
#undef AI_MASK
#undef AI_ALL
#undef AI_V4MAPPED_CFG
Expand All @@ -88,8 +89,9 @@
#define AI_PASSIVE 0x00000001 /* get address to use bind() */
#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */
#define AI_NUMERICSERV 0x00000008 /* prevent service resolution */
/* valid flags for addrinfo */
#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV)

#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */
Expand Down
3 changes: 3 additions & 0 deletions Modules/getaddrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ getaddrinfo(const char*hostname, const char*servname,
struct servent *sp;
const char *proto;

if (ai->ai_flags & AI_NUMERICSERV)
Comment thread
maxbachmann marked this conversation as resolved.
Outdated
return EAI_NONAME;

proto = NULL;
switch (pai->ai_socktype) {
case GAI_ANY:
Expand Down