From e95106ae90c36e56ba7d18fa6cb82cc1c00b40a9 Mon Sep 17 00:00:00 2001 From: "Angelos D. Keromytis" Date: Sun, 5 Aug 2001 11:02:04 +0000 Subject: Only flush the policies if the message type is UNSPEC. --- sys/net/pfkeyv2.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'sys/net/pfkeyv2.c') diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c index 4daac035e3f..9e4b5753657 100644 --- a/sys/net/pfkeyv2.c +++ b/sys/net/pfkeyv2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2.c,v 1.75 2001/07/06 13:31:07 ho Exp $ */ +/* $OpenBSD: pfkeyv2.c,v 1.76 2001/08/05 11:02:03 angelos Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 @@ -1263,10 +1263,13 @@ pfkeyv2_send(struct socket *socket, void *message, int len) case SADB_FLUSH: rval = 0; - s = spltdb(); - while ((ipo = TAILQ_FIRST(&ipsec_policy_head)) != NULL) - ipsec_delete_policy(ipo); - splx(s); + if (smsg->sadb_msg_satype == SADB_SATYPE_UNSPEC) + { + s = spltdb(); + while ((ipo = TAILQ_FIRST(&ipsec_policy_head)) != NULL) + ipsec_delete_policy(ipo); + splx(s); + } switch(smsg->sadb_msg_satype) { -- cgit v1.2.3