From 9673f305038f6d71a92b1ba94aa84a3b36d0aa6d Mon Sep 17 00:00:00 2001 From: Brandon Bergren Date: Tue, 15 Sep 2020 20:47:33 +0000 Subject: [PATCH] [PowerPC64LE] Use correct in_masks table on LE to fix checksumming Due to a check that should have been an endian check being an #if 0, the wrong checksum mask table was being used on LE, which was causing extreme strangeness in DNS resolution -- *some* hosts would be resolvable, but most would not. This fixes DNS resolution. (I am committing some parts of the LE patchset ahead of time to reduce the amount of work I have to do while committing the main patchset.) Sponsored by: Tag1 Consulting, Inc. --- sys/powerpc/powerpc/in_cksum.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/powerpc/in_cksum.c b/sys/powerpc/powerpc/in_cksum.c index ed0881d7520a..906dc7e8d9a3 100644 --- a/sys/powerpc/powerpc/in_cksum.c +++ b/sys/powerpc/powerpc/in_cksum.c @@ -42,6 +42,7 @@ #include /* RCS ID & Copyright macro defns */ +#include #include #include #include @@ -73,7 +74,7 @@ } static const u_int32_t in_masks[] = { -#if 0 +#if _BYTE_ORDER == _LITTLE_ENDIAN /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */