aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-09-09 10:43:44 +0200
committerMartin Willi <martin@revosec.ch>2013-09-13 13:56:31 +0200
commit791fde166998fa1f48c837576ec155e38bcdd1be (patch)
tree4a6dd8436fab53ea8fefc2ce562b770c49801231
parent11ac36b016a12c1d9d4fc1a1e0e2bf450566cae7 (diff)
downloadstrongswan-791fde166998fa1f48c837576ec155e38bcdd1be.tar.bz2
strongswan-791fde166998fa1f48c837576ec155e38bcdd1be.tar.xz
stroke: don't remove a matching peer config if used by other child configs
When configurations get merged during add, we should not remove peer configs if other connection entries use the same peer config.
-rw-r--r--src/libcharon/plugins/stroke/stroke_config.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libcharon/plugins/stroke/stroke_config.c b/src/libcharon/plugins/stroke/stroke_config.c
index c069d5083..edfa8a9c3 100644
--- a/src/libcharon/plugins/stroke/stroke_config.c
+++ b/src/libcharon/plugins/stroke/stroke_config.c
@@ -1235,7 +1235,7 @@ METHOD(stroke_config_t, del, void,
this->mutex->lock(this->mutex);
enumerator = this->list->create_enumerator(this->list);
- while (enumerator->enumerate(enumerator, (void**)&peer))
+ while (enumerator->enumerate(enumerator, &peer))
{
bool keep = FALSE;
@@ -1256,12 +1256,11 @@ METHOD(stroke_config_t, del, void,
}
children->destroy(children);
- /* if peer config matches, or has no children anymore, remove it */
- if (!keep || streq(peer->get_name(peer), msg->del_conn.name))
+ /* if peer config has no children anymore, remove it */
+ if (!keep)
{
this->list->remove_at(this->list, enumerator);
peer->destroy(peer);
- deleted = TRUE;
}
}
enumerator->destroy(enumerator);