Date: Wed, 31 Aug 2016 11:51:52 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305122 - head/sys/netipsec Message-ID: <201608311151.u7VBpqhH096791@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Wed Aug 31 11:51:52 2016 New Revision: 305122 URL: https://svnweb.freebsd.org/changeset/base/305122 Log: Remove redundant sanity checks from ipsec[46]_common_input_cb(). This check already has been done in the each protocol callback. Modified: head/sys/netipsec/ipsec_input.c Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Wed Aug 31 11:10:39 2016 (r305121) +++ head/sys/netipsec/ipsec_input.c Wed Aug 31 11:51:52 2016 (r305122) @@ -334,14 +334,6 @@ ipsec4_common_input_cb(struct mbuf *m, s 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, s 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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608311151.u7VBpqhH096791>