summaryrefslogtreecommitdiff
path: root/sys/netinet/ipsec_input.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-10-13 22:49:12 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-10-13 22:49:12 +0000
commit9a9a068a78ad32eef9ab064ce980f09b3446a69d (patch)
treee780bd0c403f6b90a774516c8278b05f3647171f /sys/netinet/ipsec_input.c
parentd7fb2512dd99167f87af5a8a158c9eea720faf3b (diff)
Remove redundant NULL checks in IPsec which are never reached.
ok mvs@
Diffstat (limited to 'sys/netinet/ipsec_input.c')
-rw-r--r--sys/netinet/ipsec_input.c15
1 files changed, 1 insertions, 14 deletions
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)) {