aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2012-09-21 18:13:42 +0200
committerTobias Brunner <tobias@strongswan.org>2012-09-21 18:14:17 +0200
commit6676769e8c686f9eba5f82ef83a9300d97187eec (patch)
tree7a1c5b7dbd565101e63eda6fc3ce086ecdb6f484 /src
parent0d33f428d1acf55fb356181c8fe7690c48764469 (diff)
downloadstrongswan-6676769e8c686f9eba5f82ef83a9300d97187eec.tar.bz2
strongswan-6676769e8c686f9eba5f82ef83a9300d97187eec.tar.xz
Make sure we propose a dynamic TS if we don't have hosts to derive a TS from
7ee37114 removed this behavior.
Diffstat (limited to 'src')
-rw-r--r--src/libcharon/config/child_cfg.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/libcharon/config/child_cfg.c b/src/libcharon/config/child_cfg.c
index e65f32022..b675c908f 100644
--- a/src/libcharon/config/child_cfg.c
+++ b/src/libcharon/config/child_cfg.c
@@ -258,19 +258,17 @@ METHOD(child_cfg_t, get_traffic_selectors, linked_list_t*,
/* In a first step, replace "dynamic" TS with the host list */
while (e1->enumerate(e1, &ts1))
{
- if (ts1->is_dynamic(ts1))
+ if (hosts && hosts->get_count(hosts) &&
+ ts1->is_dynamic(ts1))
{
- if (hosts)
+ e2 = hosts->create_enumerator(hosts);
+ while (e2->enumerate(e2, &host))
{
- e2 = hosts->create_enumerator(hosts);
- while (e2->enumerate(e2, &host))
- {
- ts2 = ts1->clone(ts1);
- ts2->set_address(ts2, host);
- result->insert_last(derived, ts2);
- }
- e2->destroy(e2);
+ ts2 = ts1->clone(ts1);
+ ts2->set_address(ts2, host);
+ derived->insert_last(derived, ts2);
}
+ e2->destroy(e2);
}
else
{