Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec PR/50905: Henning Petersen: Fix useless compari...
details: https://anonhg.NetBSD.org/src/rev/6006a94b0fa6
branches: trunk
changeset: 343964:6006a94b0fa6
user: christos <christos%NetBSD.org@localhost>
date: Mon Mar 07 13:08:48 2016 +0000
description:
PR/50905: Henning Petersen: Fix useless comparison (from FreeBSD)
diffstat:
sys/netipsec/key.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (39 lines):
diff -r 3f65a2c74264 -r 6006a94b0fa6 sys/netipsec/key.c
--- a/sys/netipsec/key.c Mon Mar 07 12:48:53 2016 +0000
+++ b/sys/netipsec/key.c Mon Mar 07 13:08:48 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: key.c,v 1.96 2016/03/06 04:19:51 christos Exp $ */
+/* $NetBSD: key.c,v 1.97 2016/03/07 13:08:48 christos Exp $ */
/* $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $ */
/* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.96 2016/03/06 04:19:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.97 2016/03/07 13:08:48 christos Exp $");
/*
* This code is referd to RFC 2367
@@ -7333,6 +7333,7 @@
{
struct sadb_msg *msg;
struct sadb_msghdr mh;
+ u_int orglen;
int error;
int target;
@@ -7352,10 +7353,11 @@
return ENOBUFS;
}
msg = mtod(m, struct sadb_msg *);
+ orglen = PFKEY_UNUNIT64(msg->sadb_msg_len);
target = KEY_SENDUP_ONE;
if ((m->m_flags & M_PKTHDR) == 0 ||
- m->m_pkthdr.len != m->m_pkthdr.len) {
+ m->m_pkthdr.len != orglen) {
ipseclog((LOG_DEBUG, "key_parse: invalid message length.\n"));
PFKEY_STATINC(PFKEY_STAT_OUT_INVLEN);
error = EINVAL;
Home |
Main Index |
Thread Index |
Old Index