]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth dnsproxy: fix build on s390x 14047/head
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Sat, 6 Apr 2024 21:51:35 +0000 (23:51 +0200)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Sat, 6 Apr 2024 21:51:35 +0000 (23:51 +0200)
pdns/dnsproxy.cc

index b2bd56337b639f3e7a4482e1bc132095d8baaf9c..26a0aa0805f4b8e4bd507a2592f85110cde2f6a8 100644 (file)
@@ -240,10 +240,11 @@ void DNSProxy::mainloop()
       memcpy(&dHead, &buffer[0], sizeof(dHead));
       {
         auto conntrack = d_conntrack.lock();
-#if BYTE_ORDER == BIG_ENDIAN
-        // this is needed because spoof ID down below does not respect the native byteorder
-        d.id = (256 * (uint16_t)buffer[1]) + (uint16_t)buffer[0];
-#endif
+        if (BYTE_ORDER == BIG_ENDIAN) {
+          // this is needed because spoof ID down below does not respect the native byteorder
+          dHead.id = (256 * (uint16_t)buffer[1]) + (uint16_t)buffer[0];
+        }
+
         auto iter = conntrack->find(dHead.id ^ d_xor);
         if (iter == conntrack->end()) {
           g_log << Logger::Error << "Discarding untracked packet from recursor backend with id " << (dHead.id ^ d_xor) << ". Conntrack table size=" << conntrack->size() << endl;