From: Robert Edmonds Date: Sat, 16 Apr 2016 00:54:22 +0000 (-0400) Subject: dnswasher: Write obfuscated IPv6 prefixes in network byte order X-Git-Tag: dnsdist-1.0.0~9^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40ff5c7d1932b36540155f11a2b9649fe00e03e3;p=pdns dnswasher: Write obfuscated IPv6 prefixes in network byte order Make the IPv6 code path follow the IPv4 code path by writing out the IPObfuscator counter in network byte order. This makes the obfuscated IPv6 addresses easier to read and avoids making the output of the tool vary based on the host byte order. --- diff --git a/pdns/dnswasher.cc b/pdns/dnswasher.cc index 2ebff8e2b..d627e1268 100644 --- a/pdns/dnswasher.cc +++ b/pdns/dnswasher.cc @@ -17,6 +17,7 @@ otherwise, obfuscate the response IP address #endif #include "statbag.hh" #include "dnspcap.hh" +#include "iputils.hh" #include "namespaces.hh" #include "namespaces.hh" @@ -89,9 +90,9 @@ try uint64_t *dst=(uint64_t*)&pr.d_ip6->ip6_dst; if(dh->qr) - *dst=ipo.obf6(*dst); + *dst=htobe64(ipo.obf6(*dst)); else - *src=ipo.obf6(*src); + *src=htobe64(ipo.obf6(*src)); } pw.write(); }