summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2011-08-02 22:51:38 +0000
committermarkus <markus@openbsd.org>2011-08-02 22:51:38 +0000
commitf0f84d76448a489e9965ab2962ba5473ca795f6a (patch)
treec1135c714bf627073025fb8bf7034e5d602e6b37
parentDisable upgrade-time sysmerge for the 5.0 release. Between 4.9 and 5.0 (diff)
downloadwireguard-openbsd-f0f84d76448a489e9965ab2962ba5473ca795f6a.tar.xz
wireguard-openbsd-f0f84d76448a489e9965ab2962ba5473ca795f6a.zip
add refcounting for "Configuration" section for acquire-mode SAs
ok mikeb@
-rw-r--r--sbin/isakmpd/pf_key_v2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c
index ffca011c4a6..ac322333898 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.186 2010/09/22 13:45:16 mikeb Exp $ */
+/* $OpenBSD: pf_key_v2.c,v 1.187 2011/08/02 22:51:38 markus Exp $ */
/* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */
/*
@@ -2108,7 +2108,7 @@ passed:
af = conf_begin();
configname = conf_get_str(section, "Configuration");
- conf_remove_section(af, configname);
+ pf_key_v2_conf_refhandle(af, configname);
/* These are the Phase 2 Local/Remote IDs. */
localid = conf_get_str(section, "Local-ID");
@@ -3272,6 +3272,7 @@ pf_key_v2_acquire(struct pf_key_v2_msg *pmsg)
if (!conf_get_str(configname, "Exchange_type")) {
if (conf_set(af, configname, "Exchange_type", "Quick_mode",
0, 0) ||
+ conf_set(af, peer, "Refcount", "1", 0, 0) ||
conf_set(af, configname, "DOI", "IPSEC", 0, 0)) {
conf_end(af, 0);
goto fail;
@@ -3290,7 +3291,8 @@ pf_key_v2_acquire(struct pf_key_v2_msg *pmsg)
goto fail;
}
}
- }
+ } else
+ pf_key_v2_conf_refinc(af, configname);
/* Set the ISAKMP-peer section. */
if (!conf_get_str(peer, "Phase")) {