summaryrefslogtreecommitdiff
path: root/sbin/iked/policy.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2014-02-21 20:52:39 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2014-02-21 20:52:39 +0000
commit2b50af7c9de53fbb89f291fcfccebead5bf4c675 (patch)
tree289df4b5265a356dee7671bc438c69b1e62b409a /sbin/iked/policy.c
parent91b2958e49611dab4d66c35180640ecce1176320 (diff)
support rekeying for IPCOMP; ok mikeb@
Diffstat (limited to 'sbin/iked/policy.c')
-rw-r--r--sbin/iked/policy.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sbin/iked/policy.c b/sbin/iked/policy.c
index 3f7ed72c315..9292faf849a 100644
--- a/sbin/iked/policy.c
+++ b/sbin/iked/policy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: policy.c,v 1.30 2014/02/17 15:53:46 markus Exp $ */
+/* $OpenBSD: policy.c,v 1.31 2014/02/21 20:52:38 markus Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -415,11 +415,19 @@ sa_address(struct iked_sa *sa, struct iked_addr *addr,
}
void
-childsa_free(struct iked_childsa *sa)
+childsa_free(struct iked_childsa *csa)
{
- ibuf_release(sa->csa_encrkey);
- ibuf_release(sa->csa_integrkey);
- free(sa);
+ if (csa->csa_children) {
+ /* XXX should not happen */
+ log_warnx("%s: trying to remove CSA %p children %u",
+ __func__, csa, csa->csa_children);
+ return;
+ }
+ if (csa->csa_parent)
+ csa->csa_parent->csa_children--;
+ ibuf_release(csa->csa_encrkey);
+ ibuf_release(csa->csa_integrkey);
+ free(csa);
}
struct iked_childsa *