]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/dns.cpp
Fix problem where in certain cases a \0 would be sent out. Thx to network Hak5IRC...
[user/henk/code/inspircd.git] / src / dns.cpp
index 49cfa3f1fbc3b380b83cef6b8fcc4654858a3a58..c3e909700fb57c89f155e031cde74ca902ea698a 100644 (file)
@@ -29,6 +29,7 @@ looks like this, walks like this or tastes like this.
 #include <arpa/inet.h>
 #else
 #include "inspircd_win32wrapper.h"
+#include "inspircd_se_config.h"
 #endif
 
 #include "dns.h"
@@ -623,8 +624,7 @@ DNSResult DNS::GetResult()
 #endif
        const char* ipaddr_from;
        unsigned short int port_from = 0;
-
-       int length = recvfrom(this->GetFd(),(char*)buffer,sizeof(DNSHeader),0,from,&x);
+       int length = _recvfrom(this->GetFd(),(char*)buffer,sizeof(DNSHeader),0,from,&x);
 
        /* Did we get the whole header? */
        if (length < 12)
@@ -651,14 +651,11 @@ DNSResult DNS::GetResult()
                port_from = ntohs(((sockaddr_in6*)from)->sin6_port);
        }
        else
+#endif
        {
                ipaddr_from = inet_ntoa(((sockaddr_in*)from)->sin_addr);
                port_from = ntohs(((sockaddr_in*)from)->sin_port);
        }
-#else
-       ipaddr_from = inet_ntoa(((sockaddr_in*)from)->sin_addr);
-       port_from = ntohs(((sockaddr_in*)from)->sin_port);
-#endif
 
        delete[] from;