pdns: unbreak bigendian builds
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 11 Apr 2024 13:56:37 +0000 (15:56 +0200)
committerRosen Penev <rosenp@gmail.com>
Sat, 13 Apr 2024 21:04:32 +0000 (14:04 -0700)
Signed-off-by: Peter van Dijk <peter.van.dijk@powerdns.com>
net/pdns/Makefile
net/pdns/patches/200-dnsproxy-endian.patch [new file with mode: 0644]

index 90a772e1979240d372835913bdfe89ac2a0c79a9..10ffc9d2efc45e76befe83c091a05cd730b1e03b 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pdns
 PKG_VERSION:=4.9.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
diff --git a/net/pdns/patches/200-dnsproxy-endian.patch b/net/pdns/patches/200-dnsproxy-endian.patch
new file mode 100644 (file)
index 0000000..064a0b8
--- /dev/null
@@ -0,0 +1,24 @@
+commit c6b1e59f3b413493551910a7d0a3e9206d488599
+Author: Chris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
+Date:   Sat Apr 6 23:51:35 2024 +0200
+
+    auth dnsproxy: fix build on s390x
+
+--- a/pdns/dnsproxy.cc
++++ b/pdns/dnsproxy.cc
+@@ -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;