Merge remote-tracking branch 'remotes/IOMultiplexer/v2'
[NextIRCd.git] / src / IOHandler / IODNSLookup.c
index 732cc0efedaef4434cd281d56c2a346c14fce113..36c1f044cd23b45ddfa62085d5368f234dbfbe17 100644 (file)
@@ -6,6 +6,7 @@
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  * 
+ * 
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -37,6 +38,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #endif
+#include "compat/inet.h"
 
 #include <string.h>
 
@@ -228,17 +230,17 @@ void iodns_abort(struct IODNSQuery *descriptor) {
        _stop_dnsquery(query);
 }
 
-int iodns_print_address(struct IODNSAddress *addr, int ipv6, const char *buffer, int length) {
+int iodns_print_address(struct IODNSAddress *address, int ipv6, char *buffer, int length) {
        int af;
        void *addr;
        if(ipv6) {
                af = AF_INET6;
-               addr = (void *)(&((struct sockaddr_in6 *)sockaddr->address)->sin6_addr);
+               addr = (void *)(&((struct sockaddr_in6 *)address->address)->sin6_addr);
        } else {
                af = AF_INET;
-               addr = (void *)(&((struct sockaddr_in *)sockaddr->address)->sin_addr);
+               addr = (void *)(&((struct sockaddr_in *)address->address)->sin_addr);
        }
-       buffer = inet_ntop(af, addr, buffer, length);
+       buffer = (char*) inet_ntop(af, addr, buffer, length);
        if(!buffer)
                return 0;
        else