]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
add IPv6 support to dnstcpbench (for shame)
authorbert hubert <bert.hubert@netherlabs.nl>
Tue, 11 Jun 2013 14:33:39 +0000 (16:33 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 11 Jun 2013 14:33:39 +0000 (16:33 +0200)
pdns/dnstcpbench.cc
pdns/docs/dnstcpbench.1.txt

index ce0f7cd7b59b6fa6d4e29f0d4302522926deccaf..d61a9a204d11638e4dcd75683336fc7b183a82a8 100644 (file)
@@ -26,7 +26,7 @@ try
   string reply;
 
   if(!g_onlyTCP) {
-    Socket udpsock(InterNetwork, Datagram);
+    Socket udpsock((AddressFamily)dest.sin4.sin_family, Datagram);
     
     udpsock.sendTo(string((char*)&*packet.begin(), (char*)&*packet.end()), dest);
     ComboAddress origin;
@@ -45,7 +45,7 @@ try
     g_truncates++;
   }
 
-  Socket sock(InterNetwork, Stream);
+  Socket sock((AddressFamily)dest.sin4.sin_family, Stream);
   int tmp=1;
   if(setsockopt(sock.getHandle(),SOL_SOCKET,SO_REUSEADDR,(char*)&tmp,sizeof tmp)<0) 
     throw runtime_error("Unable to set socket reuse: "+string(strerror(errno)));
@@ -103,6 +103,7 @@ catch(...)
    If a worker reaches the end of its queue, it stops */
 
 AtomicCounter g_pos;
+
 struct Query
 {
   Query(const std::string& qname_, uint16_t qtype_) : qname(qname_), qtype(qtype_) {}
@@ -114,7 +115,7 @@ struct Query
 vector<Query> g_queries;
 ComboAddress g_dest;
 
-void* worker(void*)
+static void* worker(void*)
 {
   Query q;
   for(;;) {
index a778d93658e697a009fe338da246d3e28fb93cfb..8758e8ac9381ab7c5a211ffd1ee72299fca94d8c 100644 (file)
@@ -27,6 +27,8 @@ performed by running:
 \r
    # echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle \r
 \r
+The equivalent for IPv6 is not known.\r
+\r
 OPTIONS
 -------
 
@@ -46,14 +48,14 @@ OPTIONS
 --help::\r
        Provide a helpful message\r
 \r
+Remote IP address can be IPv4 or IPv6. Remote port defaults to 53.\r
+\r
 BUGS
 ----
 Currently the timeout code does not actually perform non-blocking connects\r
 or writes.  So a slow connect or slow writes will still cause low\r
 performance and delays. \r
 \r
-Does not yet support IPv6 testing.\r
-
 AUTHOR
 ------
 Written by PowerDNS.COM BV, bert hubert, <bert.hubert@netherlabs.nl>