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:
ae 2016-08-31 11:51:52 +00:00
parent 12e19f5a90
commit 0495eb656a

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) {