Remove redundant sanity checks from ipsec[46]_common_input_cb().

This check already has been done in the each protocol callback.
This commit is contained in:
Andrey V. Elsukov 2016-08-31 11:51:52 +00:00
parent a95582c6fd
commit 0c127808dd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305122

View File

@ -334,14 +334,6 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip,
sproto == IPPROTO_IPCOMP,
("unexpected security protocol %u", sproto));
/* Sanity check */
if (m == NULL) {
DPRINTF(("%s: null mbuf", __func__));
IPSEC_ISTAT(sproto, badkcr);
KEY_FREESAV(&sav);
return EINVAL;
}
if (skip != 0) {
/*
* Fix IPv4 header
@ -615,14 +607,6 @@ ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip,
sproto == IPPROTO_IPCOMP,
("unexpected security protocol %u", sproto));
/* Sanity check */
if (m == NULL) {
DPRINTF(("%s: null mbuf", __func__));
IPSEC_ISTAT(sproto, badkcr);
error = EINVAL;
goto bad;
}
/* Fix IPv6 header */
if (m->m_len < sizeof(struct ip6_hdr) &&
(m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) {