lbalhar / rpms / bind

Forked from rpms/bind 6 years ago
Clone
4d8c709
From 90416594843a56550e40b11561807786219ce1c4 Mon Sep 17 00:00:00 2001
4d8c709
From: Evan Hunt <each@isc.org>
4d8c709
Date: Mon, 11 Sep 2017 15:01:36 -0700
4d8c709
Subject: [PATCH] remap getaddrinfo() to irs_getgetaddrinfo()
4d8c709
4d8c709
The libirs version of getaddrinfo() cannot be called from within BIND9.
4d8c709
4d8c709
fix prototypes
4d8c709
---
4d8c709
 lib/irs/include/irs/netdb.h.in | 94 ++++++++++++++++++++++++++++++++++++++++++
4d8c709
 1 file changed, 94 insertions(+)
4d8c709
4d8c709
diff --git a/lib/irs/include/irs/netdb.h.in b/lib/irs/include/irs/netdb.h.in
4d8c709
index 23dcd37..f36113d 100644
4d8c709
--- a/lib/irs/include/irs/netdb.h.in
4d8c709
+++ b/lib/irs/include/irs/netdb.h.in
4d8c709
@@ -150,6 +150,100 @@ struct addrinfo {
4d8c709
 #define	NI_DGRAM	0x00000010
4d8c709
 
4d8c709
 /*
4d8c709
+ * Define to map into irs_ namespace.
4d8c709
+ */
4d8c709
+
4d8c709
+#define IRS_NAMESPACE
4d8c709
+
4d8c709
+#ifdef IRS_NAMESPACE
4d8c709
+
4d8c709
+/*
4d8c709
+ * Use our versions not the ones from the C library.
4d8c709
+ */
4d8c709
+
4d8c709
+#ifdef getnameinfo
4d8c709
+#undef getnameinfo
4d8c709
+#endif
4d8c709
+#define getnameinfo irs_getnameinfo
4d8c709
+
4d8c709
+#ifdef getaddrinfo
4d8c709
+#undef getaddrinfo
4d8c709
+#endif
4d8c709
+#define getaddrinfo irs_getaddrinfo
4d8c709
+
4d8c709
+#ifdef freeaddrinfo
4d8c709
+#undef freeaddrinfo
4d8c709
+#endif
4d8c709
+#define freeaddrinfo irs_freeaddrinfo
4d8c709
+
4d8c709
+#ifdef gai_strerror
4d8c709
+#undef gai_strerror
4d8c709
+#endif
4d8c709
+#define gai_strerror irs_gai_strerror
4d8c709
+
4d8c709
+#endif
4d8c709
+
4d8c709
+extern int getaddrinfo (const char *name,
4d8c709
+			const char *service,
4d8c709
+			const struct addrinfo *req,
4d8c709
+			struct addrinfo **pai);
4d8c709
+extern int getnameinfo (const struct sockaddr *sa,
4d8c709
+			socklen_t salen, char *host,
4d8c709
+			socklen_t hostlen, char *serv,
4d8c709
+			socklen_t servlen, int flags);
4d8c709
+extern void freeaddrinfo (struct addrinfo *ai);
4d8c709
+extern const char *gai_strerror (int ecode);
4d8c709
+
4d8c709
+/*
4d8c709
+ * Define to map into irs_ namespace.
4d8c709
+ */
4d8c709
+
4d8c709
+#define IRS_NAMESPACE
4d8c709
+
4d8c709
+#ifdef IRS_NAMESPACE
4d8c709
+
4d8c709
+/*
4d8c709
+ * Use our versions not the ones from the C library.
4d8c709
+ */
4d8c709
+
4d8c709
+#ifdef getnameinfo
4d8c709
+#undef getnameinfo
4d8c709
+#endif
4d8c709
+#define getnameinfo irs_getnameinfo
4d8c709
+
4d8c709
+#ifdef getaddrinfo
4d8c709
+#undef getaddrinfo
4d8c709
+#endif
4d8c709
+#define getaddrinfo irs_getaddrinfo
4d8c709
+
4d8c709
+#ifdef freeaddrinfo
4d8c709
+#undef freeaddrinfo
4d8c709
+#endif
4d8c709
+#define freeaddrinfo irs_freeaddrinfo
4d8c709
+
4d8c709
+#ifdef gai_strerror
4d8c709
+#undef gai_strerror
4d8c709
+#endif
4d8c709
+#define gai_strerror irs_gai_strerror
4d8c709
+
4d8c709
+int
4d8c709
+getaddrinfo(const char *hostname, const char *servname,
4d8c709
+	    const struct addrinfo *hints, struct addrinfo **res);
4d8c709
+
4d8c709
+int
4d8c709
+getnameinfo(const struct sockaddr *sa, IRS_GETNAMEINFO_SOCKLEN_T salen,
4d8c709
+	    char *host, IRS_GETNAMEINFO_BUFLEN_T hostlen,
4d8c709
+	    char *serv, IRS_GETNAMEINFO_BUFLEN_T servlen,
4d8c709
+	    IRS_GETNAMEINFO_FLAGS_T flags);
4d8c709
+
4d8c709
+void freeaddrinfo (struct addrinfo *ai);
4d8c709
+
4d8c709
+IRS_GAISTRERROR_RETURN_T
4d8c709
+gai_strerror(int ecode);
4d8c709
+
4d8c709
+#endif
4d8c709
+
4d8c709
+/*
4d8c709
  * Tell Emacs to use C mode on this file.
4d8c709
  * Local variables:
4d8c709
  * mode: c
4d8c709
-- 
4d8c709
2.9.5
4d8c709