summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorangelos <angelos@openbsd.org>2001-07-01 05:16:03 +0000
committerangelos <angelos@openbsd.org>2001-07-01 05:16:03 +0000
commit034b5da340c27f537e7c6c96fc2cdeee27726651 (patch)
treec7c4d4f31a5f22f16fb8ada29ac9b49e2dbea82f
parentMore prototype/header file cleanup. (diff)
downloadwireguard-openbsd-034b5da340c27f537e7c6c96fc2cdeee27726651.tar.xz
wireguard-openbsd-034b5da340c27f537e7c6c96fc2cdeee27726651.zip
Don't try to delete unestablished SPIs.
-rw-r--r--sbin/isakmpd/pf_key_v2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c
index de06d708f24..5f1dc88192e 100644
--- a/sbin/isakmpd/pf_key_v2.c
+++ b/sbin/isakmpd/pf_key_v2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_key_v2.c,v 1.72 2001/06/29 19:08:11 ho Exp $ */
+/* $OpenBSD: pf_key_v2.c,v 1.73 2001/07/01 05:16:03 angelos Exp $ */
/* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */
/*
@@ -2350,6 +2350,10 @@ pf_key_v2_delete_spi (struct sa *sa, struct proto *proto, int incoming)
struct sadb_x_sa2 ssa2;
#endif
+ /* If it's not an established SA, don't proceed. */
+ if (!(sa->flags & SA_FLAG_READY))
+ return 0;
+
/*
* If the SA was not replaced and was not one acquired through the
* kernel (ACQUIRE message), remove the flow associated with it.