diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-04 11:03:21 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-04 11:03:21 +0000 |
commit | b8c3c5d25b84b358fc93eea0e885372dcad01480 (patch) | |
tree | d34a50599900d4b6d51d1c1635546c5be828781b /src/dns.cpp | |
parent | a361a0bbc980a44e775c868b34d6c01f545a8515 (diff) |
Safety wrapper defines for ipv6 code on ipv4 ircds
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4697 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/dns.cpp')
-rw-r--r-- | src/dns.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dns.cpp b/src/dns.cpp index 42db21424..0a22b28d8 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -453,7 +453,7 @@ int DNS::GetNameForce(const char *ip, ForceProtocol fp) DNSHeader h; int id; int length; - +#ifdef SUPPORT_IP6LINKS if (fp == PROTOCOL_IPV6) { in6_addr i; @@ -466,6 +466,7 @@ int DNS::GetNameForce(const char *ip, ForceProtocol fp) return -1; } else +#endif { in_addr i; if (inet_aton(ip, &i)) @@ -493,6 +494,7 @@ int DNS::GetNameForce(const char *ip, ForceProtocol fp) void DNS::MakeIP6Int(char* query, const in6_addr *ip) { +#ifdef SUPPORT_IP6LINKS const char* hex = "0123456789abcdef"; for (int index = 31; index >= 0; index--) /* for() loop steps twice per byte */ { @@ -505,6 +507,9 @@ void DNS::MakeIP6Int(char* query, const in6_addr *ip) *query++ = '.'; /* Seperator */ } strcpy(query,"ip6.arpa"); /* Suffix the string */ +#else + *query = 0; +#endif } /* Return the next id which is ready, and the result attached to it */ |