Do not ignore configs for IKEv1 in charon anymore
authorMartin Willi <martin@revosec.ch>
Fri, 18 Nov 2011 09:08:18 +0000 (10:08 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:30:43 +0000 (17:30 +0100)
src/libcharon/plugins/smp/smp.c
src/libcharon/plugins/stroke/stroke_control.c
src/libcharon/plugins/stroke/stroke_list.c
src/libcharon/processing/jobs/start_action_job.c
src/starter/confread.c
src/starter/starter.c

index 2743b72..0db2874 100644 (file)
@@ -302,11 +302,6 @@ static void request_query_config(xmlTextReaderPtr reader, xmlTextWriterPtr write
                ike_cfg_t *ike_cfg;
                linked_list_t *list;
 
-               if (peer_cfg->get_ike_version(peer_cfg) != IKEV2)
-               {       /* only IKEv2 connections yet */
-                       continue;
-               }
-
                /* <peerconfig> */
                xmlTextWriterStartElement(writer, "peerconfig");
                xmlTextWriterWriteElement(writer, "name", peer_cfg->get_name(peer_cfg));
index 5897862..98f57b5 100644 (file)
@@ -126,14 +126,6 @@ METHOD(stroke_control_t, initiate, void,
                                                                                                          msg->initiate.name);
        if (peer_cfg)
        {
-               if (peer_cfg->get_ike_version(peer_cfg) != IKEV2)
-               {
-                       DBG1(DBG_CFG, "ignoring initiation request for %N config",
-                                ike_version_names, peer_cfg->get_ike_version(peer_cfg));
-                       peer_cfg->destroy(peer_cfg);
-                       return;
-               }
-
                child_cfg = get_child_from_peer(peer_cfg, msg->initiate.name);
                if (child_cfg == NULL)
                {
@@ -161,10 +153,6 @@ METHOD(stroke_control_t, initiate, void,
                                                                                                        NULL, NULL, NULL, NULL);
                while (enumerator->enumerate(enumerator, &peer_cfg))
                {
-                       if (peer_cfg->get_ike_version(peer_cfg) != IKEV2)
-                       {
-                               continue;
-                       }
                        child_cfg = get_child_from_peer(peer_cfg, msg->initiate.name);
                        if (child_cfg)
                        {
@@ -568,14 +556,6 @@ METHOD(stroke_control_t, route, void,
                                                                                                          msg->route.name);
        if (peer_cfg)
        {
-               if (peer_cfg->get_ike_version(peer_cfg) != IKEV2)
-               {
-                       DBG1(DBG_CFG, "ignoring initiation request for %N config",
-                                ike_version_names, peer_cfg->get_ike_version(peer_cfg));
-                       peer_cfg->destroy(peer_cfg);
-                       return;
-               }
-
                child_cfg = get_child_from_peer(peer_cfg, msg->route.name);
                if (child_cfg == NULL)
                {
@@ -603,10 +583,6 @@ METHOD(stroke_control_t, route, void,
                                                                                                        NULL, NULL, NULL, NULL);
                while (enumerator->enumerate(enumerator, &peer_cfg))
                {
-                       if (peer_cfg->get_ike_version(peer_cfg) != IKEV2)
-                       {
-                               continue;
-                       }
                        child_cfg = get_child_from_peer(peer_cfg, msg->route.name);
                        if (child_cfg)
                        {
index 4145a79..2246e74 100644 (file)
@@ -489,8 +489,7 @@ METHOD(stroke_list_t, status, void,
                                                                        charon->backends, NULL, NULL, NULL, NULL);
                while (enumerator->enumerate(enumerator, &peer_cfg))
                {
-                       if (peer_cfg->get_ike_version(peer_cfg) != IKEV2 ||
-                               (name && !streq(name, peer_cfg->get_name(peer_cfg))))
+                       if (name && !streq(name, peer_cfg->get_name(peer_cfg)))
                        {
                                continue;
                        }
index 0019a11..efb53ac 100644 (file)
@@ -49,11 +49,6 @@ METHOD(job_t, execute, void,
                                                                                                        NULL, NULL, NULL, NULL);
        while (enumerator->enumerate(enumerator, &peer_cfg))
        {
-               if (peer_cfg->get_ike_version(peer_cfg) != IKEV2)
-               {
-                       continue;
-               }
-
                children = peer_cfg->create_child_cfg_enumerator(peer_cfg);
                while (children->enumerate(children, &child_cfg))
                {
index 089be1a..1da4eb0 100644 (file)
@@ -466,7 +466,7 @@ static void handle_dns_failure(const char *label, starter_end_t *end,
                        plog("# fallback to %s=%%any due to '%%' prefix or %sallowany=yes",
                                label, label);
                }
-               else if (!end->host || conn->keyexchange == KEY_EXCHANGE_IKEV1)
+               else if (!end->host)
                {
                        /* declare an error */
                        cfg->err++;
index 44e2143..15c50c4 100644 (file)
@@ -764,14 +764,11 @@ int main (int argc, char **argv)
 
                                        if (conn->startup == STARTUP_START)
                                        {
-                                               if (conn->keyexchange != KEY_EXCHANGE_IKEV1)
+                                               if (starter_charon_pid())
                                                {
-                                                       if (starter_charon_pid())
-                                                       {
-                                                               starter_stroke_initiate_conn(conn);
-                                                       }
+                                                       starter_stroke_initiate_conn(conn);
                                                }
-                                               else
+                                               if (conn->keyexchange == KEY_EXCHANGE_IKEV1)
                                                {
                                                        if (starter_pluto_pid())
                                                        {
@@ -781,14 +778,11 @@ int main (int argc, char **argv)
                                        }
                                        else if (conn->startup == STARTUP_ROUTE)
                                        {
-                                               if (conn->keyexchange != KEY_EXCHANGE_IKEV1)
+                                               if (starter_charon_pid())
                                                {
-                                                       if (starter_charon_pid())
-                                                       {
-                                                               starter_stroke_route_conn(conn);
-                                                       }
+                                                       starter_stroke_route_conn(conn);
                                                }
-                                               else
+                                               if (conn->keyexchange == KEY_EXCHANGE_IKEV1)
                                                {
                                                        if (starter_pluto_pid())
                                                        {