From 9a9a068a78ad32eef9ab064ce980f09b3446a69d Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Wed, 13 Oct 2021 22:49:12 +0000 Subject: Remove redundant NULL checks in IPsec which are never reached. ok mvs@ --- sys/netinet/ipsec_input.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'sys/netinet/ipsec_input.c') diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c index 67f94919bc1..94c5a5ffabb 100644 --- a/sys/netinet/ipsec_input.c +++ b/sys/netinet/ipsec_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsec_input.c,v 1.183 2021/10/13 22:43:44 bluhm Exp $ */ +/* $OpenBSD: ipsec_input.c,v 1.184 2021/10/13 22:49:11 bluhm Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -203,12 +203,6 @@ ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto, ipsecstat_pkt(ipsec_ipackets, ipsec_ibytes, m->m_pkthdr.len); IPSEC_ISTAT(esps_input, ahs_input, ipcomps_input); - if (m == NULL) { - DPRINTF("NULL packet received"); - IPSEC_ISTAT(esps_hdrops, ahs_hdrops, ipcomps_hdrops); - return EINVAL; - } - if ((sproto == IPPROTO_IPCOMP) && (m->m_flags & M_COMP)) { DPRINTF("repeated decompression"); ipcompstat_inc(ipcomps_pdrops); @@ -476,13 +470,6 @@ ipsec_common_input_cb(struct mbuf *m, struct tdb *tdbp, int skip, int protoff) tdbp->tdb_last_used = gettime(); - /* Sanity check */ - if (m == NULL) { - /* The called routine will print a message if necessary */ - IPSEC_ISTAT(esps_badkcr, ahs_badkcr, ipcomps_badkcr); - return -1; - } - /* Fix IPv4 header */ if (af == AF_INET) { if ((m->m_len < skip) && ((m = m_pullup(m, skip)) == NULL)) { -- cgit v1.2.3