svn commit: r365770 - head/sys/powerpc/powerpc
Brandon Bergren
bdragon at FreeBSD.org
Tue Sep 15 20:47:34 UTC 2020
Author: bdragon
Date: Tue Sep 15 20:47:33 2020
New Revision: 365770
URL: https://svnweb.freebsd.org/changeset/base/365770
Log:
[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.
Modified:
head/sys/powerpc/powerpc/in_cksum.c
Modified: head/sys/powerpc/powerpc/in_cksum.c
==============================================================================
--- head/sys/powerpc/powerpc/in_cksum.c Tue Sep 15 20:26:31 2020 (r365769)
+++ head/sys/powerpc/powerpc/in_cksum.c Tue Sep 15 20:47:33 2020 (r365770)
@@ -42,6 +42,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
+#include <sys/endian.h>
#include <sys/param.h>
#include <sys/mbuf.h>
#include <sys/systm.h>
@@ -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 */
More information about the svn-src-all
mailing list