diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-08-05 11:02:04 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-08-05 11:02:04 +0000 |
commit | e95106ae90c36e56ba7d18fa6cb82cc1c00b40a9 (patch) | |
tree | eaa74465a313263bce2b5983ab0554ad0cdc8573 /sys/net/pfkeyv2.c | |
parent | 39ebef8d909272c2d4d946965c6012134d58bd15 (diff) |
Only flush the policies if the message type is UNSPEC.
Diffstat (limited to 'sys/net/pfkeyv2.c')
-rw-r--r-- | sys/net/pfkeyv2.c | 13 |
1 files changed, 8 insertions, 5 deletions
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) { |