Commit b103b0c0 authored by Evan Hunt's avatar Evan Hunt

[master] remap getaddrinfo() to irs_getgetaddrinfo()

The libirs version of getaddrinfo() cannot be called from within BIND9.
parent a507cc48
......@@ -78,7 +78,6 @@
#include <isccfg/namedconf.h>
#include <irs/resconf.h>
#include <irs/netdb.h>
#include <bind9/getaddresses.h>
......
......@@ -68,7 +68,6 @@
#include <dst/dst.h>
#include <irs/resconf.h>
#include <irs/netdb.h>
#ifdef GSSAPI
#include <dst/gssapi.h>
......
......@@ -803,7 +803,7 @@ echo "I:ensure unresolvable server name is fatal in non-interactive mode ($n)"
$NSUPDATE <<END > nsupdate.out 2>&1 && ret=1
server unresolvable..
END
grep "couldn't get address for 'unresolvable..': failure" nsupdate.out > /dev/null || ret=1
grep "couldn't get address for 'unresolvable..': not found" nsupdate.out > /dev/null || ret=1
grep "syntax error" nsupdate.out > /dev/null || ret=1
[ $ret = 0 ] || { echo I:failed; status=1; }
......@@ -813,7 +813,7 @@ echo "I:ensure unresolvable server name is not fatal in interactive mode ($n)"
$NSUPDATE -i <<END > nsupdate.out 2>&1 || ret=1
server unresolvable..
END
grep "couldn't get address for 'unresolvable..': failure" nsupdate.out > /dev/null || ret=1
grep "couldn't get address for 'unresolvable..': not found" nsupdate.out > /dev/null || ret=1
[ $ret = 0 ] || { echo I:failed; status=1; }
n=`expr $n + 1`
......
......@@ -149,6 +149,51 @@ struct addrinfo {
#define NI_NUMERICSERV 0x00000008
#define NI_DGRAM 0x00000010
/*
* Define to map into irs_ namespace.
*/
#define IRS_NAMESPACE
#ifdef IRS_NAMESPACE
/*
* Use our versions not the ones from the C library.
*/
#ifdef getnameinfo
#undef getnameinfo
#endif
#define getnameinfo irs_getnameinfo
#ifdef getaddrinfo
#undef getaddrinfo
#endif
#define getaddrinfo irs_getaddrinfo
#ifdef freeaddrinfo
#undef freeaddrinfo
#endif
#define freeaddrinfo irs_freeaddrinfo
#ifdef gai_strerror
#undef gai_strerror
#endif
#define gai_strerror irs_gai_strerror
#endif
extern int getaddrinfo (const char *name,
const char *service,
const struct addrinfo *req,
struct addrinfo **pai);
extern int getnameinfo (const struct sockaddr *sa,
socklen_t salen, char *host,
socklen_t hostlen, char *serv,
socklen_t servlen, int flags);
extern void freeaddrinfo (struct addrinfo *ai);
extern const char *gai_strerror (int ecode);
/*
* Tell Emacs to use C mode on this file.
* Local variables:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment