summaryrefslogtreecommitdiff
path: root/contrib/bind9/lib/bind/irs/getaddrinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bind9/lib/bind/irs/getaddrinfo.c')
-rw-r--r--contrib/bind9/lib/bind/irs/getaddrinfo.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/bind9/lib/bind/irs/getaddrinfo.c b/contrib/bind9/lib/bind/irs/getaddrinfo.c
index e08cf78424bbc..4f741a8e7de23 100644
--- a/contrib/bind9/lib/bind/irs/getaddrinfo.c
+++ b/contrib/bind9/lib/bind/irs/getaddrinfo.c
@@ -244,6 +244,7 @@ do { \
goto free; \
} while (/*CONSTCOND*/0)
+#ifndef SOLARIS2
#define ERR(err) \
do { \
/* external reference: error, and label bad */ \
@@ -251,6 +252,16 @@ do { \
goto bad; \
/*NOTREACHED*/ \
} while (/*CONSTCOND*/0)
+#else
+#define ERR(err) \
+do { \
+ /* external reference: error, and label bad */ \
+ error = (err); \
+ if (error == error) \
+ goto bad; \
+} while (/*CONSTCOND*/0)
+#endif
+
#define MATCH_FAMILY(x, y, w) \
((x) == (y) || (/*CONSTCOND*/(w) && ((x) == PF_UNSPEC || (y) == PF_UNSPEC)))
@@ -321,6 +332,15 @@ getaddrinfo(hostname, servname, hints, res)
pai->ai_family = PF_UNSPEC;
pai->ai_socktype = ANY;
pai->ai_protocol = ANY;
+#ifdef __sparcv9
+ /*
+ * clear _ai_pad to preserve binary
+ * compatibility with previously compiled 64-bit
+ * applications in a pre-SUSv3 environment by
+ * guaranteeing the upper 32-bits are empty.
+ */
+ pai->_ai_pad = 0;
+#endif /* __sparcv9 */
pai->ai_addrlen = 0;
pai->ai_canonname = NULL;
pai->ai_addr = NULL;
@@ -345,6 +365,13 @@ getaddrinfo(hostname, servname, hints, res)
}
memcpy(pai, hints, sizeof(*pai));
+#ifdef __sparcv9
+ /*
+ * We need to clear _ai_pad to preserve binary
+ * compatibility. See prior comment.
+ */
+ pai->_ai_pad = 0;
+#endif
/*
* if both socktype/protocol are specified, check if they
* are meaningful combination.