summaryrefslogtreecommitdiff
path: root/resolv
diff options
context:
space:
mode:
Diffstat (limited to 'resolv')
-rw-r--r--resolv/gethnamaddr.c6
-rw-r--r--resolv/nss_dns/dns-host.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c
index f2def79e24..49aea2a719 100644
--- a/resolv/gethnamaddr.c
+++ b/resolv/gethnamaddr.c
@@ -123,6 +123,12 @@ static void addrsort __P((char **, int));
#define MAXPACKET 1024
#endif
+/* As per RFC 1034 and 1035 a host name cannot exceed 255 octets in length. */
+#ifdef MAXHOSTNAMELEN
+# undef MAXHOSTNAMELEN
+#endif
+#define MAXHOSTNAMELEN 256
+
typedef union {
HEADER hdr;
u_char buf[MAXPACKET];
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index 19ca33e197..f7721840b7 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -99,6 +99,11 @@
#else
# define MAXPACKET 1024
#endif
+/* As per RFC 1034 and 1035 a host name cannot exceed 255 octets in length. */
+#ifdef MAXHOSTNAMELEN
+# undef MAXHOSTNAMELEN
+#endif
+#define MAXHOSTNAMELEN 256
static const char AskedForGot[] = "\
gethostby*.getanswer: asked for \"%s\", got \"%s\"";