]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
handle htobe32 et al. on glibc systems with a non-Linux kernel
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 24 May 2018 16:59:26 +0000 (12:59 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 24 May 2018 16:59:26 +0000 (12:59 -0400)
This fix copies over an updated #if clause from libknot's
src/contrib/endian.h.

This should resolve:

    https://gitlab.labs.nic.cz/knot/knot-resolver/issues/348

See also discussion about this same problem in libknot from a couple
years ago:

    https://bugs.debian.org/840460

I note that contrib/wire.h in knot-resolver is out of sync with
src/contrib/wire.h (and src/contrib/endian.h) from libknot.  I don't
know whether there's any upstream preference for keeping these in sync
in some more reliable way than manual comparisons.  For now i'm just
providing a narrow fix for the specific problem.

contrib/wire.h

index e0360fe3d2bef706d3a0df923871a64680cfea19..b02296e084d872c72bc2caa29d66f07dd7a25b5f 100644 (file)
@@ -27,7 +27,8 @@
 #include <stdint.h>
 #include <string.h>
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__gnu_hurd__) || \
+    (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
 #       include <endian.h>
 #  ifndef be64toh
 #       include <arpa/inet.h>