summaryrefslogtreecommitdiffstats
path: root/sys/netipsec/ipsec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netipsec/ipsec.c')
-rw-r--r--sys/netipsec/ipsec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c
index f01f0fe..bf02f93 100644
--- a/sys/netipsec/ipsec.c
+++ b/sys/netipsec/ipsec.c
@@ -1275,6 +1275,9 @@ ipsec46_in_reject(struct mbuf *m, struct inpcb *inp)
int error;
int result;
+ if (!key_havesp(IPSEC_DIR_INBOUND))
+ return 0;
+
IPSEC_ASSERT(m != NULL, ("null mbuf"));
/* Get SP for this packet. */
@@ -1402,6 +1405,9 @@ ipsec_hdrsiz(struct mbuf *m, u_int dir, struct inpcb *inp)
int error;
size_t size;
+ if (!key_havesp(dir))
+ return 0;
+
IPSEC_ASSERT(m != NULL, ("null mbuf"));
/* Get SP for this packet. */
OpenPOWER on IntegriCloud