Module Name: src
Committed By: rin
Date: Tue Aug 28 07:28:01 UTC 2018
Modified Files:
src/sys/netinet: cpu_in_cksum.c
Log Message:
No need to update mlen also in the case of (meln & 16) != 0.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/cpu_in_cksum.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netinet/cpu_in_cksum.c
diff -u src/sys/netinet/cpu_in_cksum.c:1.1 src/sys/netinet/cpu_in_cksum.c:1.2
--- src/sys/netinet/cpu_in_cksum.c:1.1 Fri Jan 25 21:12:14 2008
+++ src/sys/netinet/cpu_in_cksum.c Tue Aug 28 07:28:01 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_in_cksum.c,v 1.1 2008/01/25 21:12:14 joerg Exp $ */
+/* $NetBSD: cpu_in_cksum.c,v 1.2 2018/08/28 07:28:01 rin Exp $ */
/*-
* Copyright (c) 2008 Joerg Sonnenberger <[email protected]>.
* All rights reserved.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.c,v 1.1 2008/01/25 21:12:14 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.c,v 1.2 2018/08/28 07:28:01 rin Exp $");
#include <sys/param.h>
#include <sys/endian.h>
@@ -162,6 +162,10 @@ cpu_in_cksum(struct mbuf *m, int len, in
partial = 0;
}
}
+ /*
+ * mlen is not updated below as the remaining tests
+ * are using bit masks, which are not affected.
+ */
if (mlen & 16) {
partial += *(uint16_t *)data;
partial += *(uint16_t *)(data + 2);
@@ -172,12 +176,7 @@ cpu_in_cksum(struct mbuf *m, int len, in
partial += *(uint16_t *)(data + 12);
partial += *(uint16_t *)(data + 14);
data += 16;
- mlen -= 16;
}
- /*
- * mlen is not updated below as the remaining tests
- * are using bit masks, which are not affected.
- */
if (mlen & 8) {
partial += *(uint16_t *)data;
partial += *(uint16_t *)(data + 2);