Ensure traffic selectors are dynamic before calling set_address() when deriving them
authorTobias Brunner <tobias@strongswan.org>
Wed, 12 Sep 2012 16:07:41 +0000 (18:07 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 12 Sep 2012 16:13:47 +0000 (18:13 +0200)
src/libcharon/config/child_cfg.c

index 1598ce0..b037158 100644 (file)
@@ -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);
                        }