vici: Properly filter by CHILD_SA name while undoing start actions
authorMartin Willi <martin@revosec.ch>
Tue, 6 May 2014 13:46:53 +0000 (15:46 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 7 May 2014 12:13:39 +0000 (14:13 +0200)
src/libcharon/plugins/vici/vici_config.c

index c180b0e..1938593 100644 (file)
@@ -1531,8 +1531,11 @@ static void clear_start_action(private_vici_config_t *this,
                                children = ike_sa->create_child_sa_enumerator(ike_sa);
                                while (children->enumerate(children, &child_sa))
                                {
-                                       reqid = child_sa->get_reqid(child_sa);
-                                       array_insert_create(&reqids, ARRAY_TAIL, &reqid);
+                                       if (streq(name, child_sa->get_name(child_sa)))
+                                       {
+                                               reqid = child_sa->get_reqid(child_sa);
+                                               array_insert_create(&reqids, ARRAY_TAIL, &reqid);
+                                       }
                                }
                                children->destroy(children);
                        }