summaryrefslogtreecommitdiffstats
path: root/sys/netipsec
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2016-03-09 10:01:28 +0000
committerae <ae@FreeBSD.org>2016-03-09 10:01:28 +0000
commit1febe34ecc1d0cb1a72a6dda1f699f469d7b2c69 (patch)
tree3f0d49a5e92b9bd4ad82d973a2df6292710a9caf /sys/netipsec
parent9ec2d8a930499ae3bc7c8c1cbb5cb96dc98b75a5 (diff)
downloadFreeBSD-src-1febe34ecc1d0cb1a72a6dda1f699f469d7b2c69.zip
FreeBSD-src-1febe34ecc1d0cb1a72a6dda1f699f469d7b2c69.tar.gz
MFC r295967:
Fix useless check. m_pkthdr.len should be equal to orglen.
Diffstat (limited to 'sys/netipsec')
-rw-r--r--sys/netipsec/key.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index a3e3d76..b231158 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -7245,8 +7245,7 @@ key_parse(struct mbuf *m, struct socket *so)
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) {
+ if ((m->m_flags & M_PKTHDR) == 0 || m->m_pkthdr.len != orglen) {
ipseclog((LOG_DEBUG, "%s: invalid message length.\n",__func__));
PFKEYSTAT_INC(out_invlen);
error = EINVAL;
OpenPOWER on IntegriCloud