full support of ikev1 and ikev2 connection flags
[strongswan.git] / src / starter / starter.c
index 88e190e..069b219 100644 (file)
@@ -331,21 +331,15 @@ int main (int argc, char **argv)
                {
                    if (conn->state == STATE_ADDED)
                    {
-                       if (conn->keyexchange == KEY_EXCHANGE_IKEV2)
+                       if (starter_charon_pid())
                        {
-                           if (starter_charon_pid())
-                           {
-                               starter_stroke_del_conn(conn);
-                           }
+                           starter_stroke_del_conn(conn);
                        }
-                       else
+                       if (starter_pluto_pid())
                        {
-                           if (starter_pluto_pid())
-                           {
-                               starter_whack_del_conn(conn);
-                               conn->state = STATE_TO_ADD;
-                           }
+                           starter_whack_del_conn(conn);
                        }
+                       conn->state = STATE_TO_ADD;
                    }
                }
                for (ca = cfg->ca_first; ca; ca = ca->next)
@@ -418,19 +412,13 @@ int main (int argc, char **argv)
                    {
                        if (conn->state == STATE_ADDED)
                        {
-                           if (conn->keyexchange == KEY_EXCHANGE_IKEV2)
+                           if (starter_charon_pid())
                            {
-                               if (starter_charon_pid())
-                               {
-                                   starter_stroke_del_conn(conn);
-                               }
+                               starter_stroke_del_conn(conn);
                            }
-                           else
+                           if (starter_pluto_pid())
                            {
-                               if (starter_pluto_pid())
-                               {
-                                   starter_whack_del_conn(conn);
-                               }
+                               starter_whack_del_conn(conn);
                            }
                        }
                    }
@@ -568,19 +556,13 @@ int main (int argc, char **argv)
                        /* affect new unique id */
                        conn->id = id++;
                    }
-                   if (conn->keyexchange == KEY_EXCHANGE_IKEV2)
+                   if (starter_charon_pid())
                    {
-                       if (starter_charon_pid())
-                       {
-                           starter_stroke_add_conn(conn);
-                       }
+                       starter_stroke_add_conn(conn);
                    }
-                   else
+                   if (starter_pluto_pid())
                    {
-                       if (starter_pluto_pid())
-                       {
-                           starter_whack_add_conn(conn);
-                       }
+                       starter_whack_add_conn(conn);
                    }
                    conn->state = STATE_ADDED;
 
@@ -614,7 +596,7 @@ int main (int argc, char **argv)
                        {
                            if (starter_pluto_pid())
                            {
-                                starter_whack_route_conn(conn);
+                               starter_whack_route_conn(conn);
                            }
                        }
                    }