aboutsummaryrefslogtreecommitdiff
path: root/resolv
diff options
context:
space:
mode:
Diffstat (limited to 'resolv')
-rw-r--r--resolv/gethnamaddr.c2
-rw-r--r--resolv/netdb.h8
2 files changed, 10 insertions, 0 deletions
diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c
index 424a6690ee..114875b910 100644
--- a/resolv/gethnamaddr.c
+++ b/resolv/gethnamaddr.c
@@ -513,6 +513,8 @@ gethostbyname2(name, af)
if (!*cp) {
if (*--cp == '.')
break;
+ if (!strchr(name, ':'))
+ break;
/*
* All-IPv6-legal, no dot at the end.
* Fake up a hostent as if we'd actually
diff --git a/resolv/netdb.h b/resolv/netdb.h
index b60f923229..41faa75e36 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -396,6 +396,14 @@ struct addrinfo
#define EAI_MEMORY -10 /* Memory allocation failure. */
#define EAI_SYSTEM -11 /* System error returned in `errno'. */
+#define NI_MAXHOST 1025
+#define NI_MAXSERV 32
+
+#define NI_NUMERICHOST 1
+#define NI_NUMERICSERV 2
+#define NI_NOFQDN 4
+#define NI_NAMEREQD 8
+#define NI_DGRAM 16
/* Translate name of a service location and/or a service name to set of
socket addresses. */