From 455accc68799bbdc3cad980ae3e1e0f23c3190bb Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 12 Sep 2012 18:07:41 +0200 Subject: [PATCH] Ensure traffic selectors are dynamic before calling set_address() when deriving them --- src/libcharon/config/child_cfg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcharon/config/child_cfg.c b/src/libcharon/config/child_cfg.c index 1598ce090..b037158d3 100644 --- a/src/libcharon/config/child_cfg.c +++ b/src/libcharon/config/child_cfg.c @@ -261,7 +261,7 @@ METHOD(child_cfg_t, get_traffic_selectors, linked_list_t*, { /* we make a copy of the TS, this allows us to update dynamic TS' */ selected = ts1->clone(ts1); - if (host) + if (host && selected->is_dynamic(selected)) { selected->set_address(selected, host); } @@ -280,7 +280,7 @@ METHOD(child_cfg_t, get_traffic_selectors, linked_list_t*, { /* we make a copy of the TS, as we have to update dynamic TS' */ ts1 = ts1->clone(ts1); - if (host) + if (host && ts1->is_dynamic(ts1)) { ts1->set_address(ts1, host); }