From 40ff5c7d1932b36540155f11a2b9649fe00e03e3 Mon Sep 17 00:00:00 2001 From: Robert Edmonds Date: Fri, 15 Apr 2016 20:54:22 -0400 Subject: [PATCH] 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. --- pdns/dnswasher.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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(); } -- 2.40.0