child-cfg: Fix removal of redundant traffic selectors
authorTobias Brunner <tobias@strongswan.org>
Fri, 25 Apr 2014 16:58:55 +0000 (18:58 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 25 Apr 2014 17:04:35 +0000 (19:04 +0200)
We have to make sure we compare every selected traffic selector with every
other in the list.

Fixes #577.

src/libcharon/config/child_cfg.c

index 6fe7d44..8d8214e 100644 (file)
@@ -354,11 +354,11 @@ METHOD(child_cfg_t, get_traffic_selectors, linked_list_t*,
                                {
                                        result->remove_at(result, e1);
                                        ts1->destroy(ts1);
-                                       result->reset_enumerator(result, e2);
                                        break;
                                }
                        }
                }
+               result->reset_enumerator(result, e2);
        }
        e1->destroy(e1);
        e2->destroy(e2);