]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnswasher: Remove offsets from IPv6 src/dst pointers
authorRobert Edmonds <edmonds@fsi.io>
Sat, 16 Apr 2016 00:48:52 +0000 (20:48 -0400)
committerRobert Edmonds <edmonds@fsi.io>
Sat, 16 Apr 2016 00:48:52 +0000 (20:48 -0400)
I'm not entirely sure why this code was offsetting the IPv6
source/destination header fields, but this commit removes those offsets.

This results in the obfuscation of the first 64 bits of the IPv6
source/destination addresses. (Arguably the whole address should be
obfuscated, though.)

pdns/dnswasher.cc

index d9f0466fa79f8bca7a093002a14bd86134be940f..2ebff8e2bb4c994091cf334400ef34b3403aba52 100644 (file)
@@ -85,8 +85,8 @@ try
 
         pr.d_ip->ip_sum=0;
       } else if (pr.d_ip->ip_v == 6) {
-        uint64_t *src=1+(uint64_t*)&pr.d_ip6->ip6_src;
-        uint64_t *dst=1+(uint64_t*)&pr.d_ip6->ip6_dst;
+        uint64_t *src=(uint64_t*)&pr.d_ip6->ip6_src;
+        uint64_t *dst=(uint64_t*)&pr.d_ip6->ip6_dst;
 
         if(dh->qr)
           *dst=ipo.obf6(*dst);