Reuse reqid for trap policies installed for dpd|closeaction=hold
authorTobias Brunner <tobias@strongswan.org>
Sat, 29 Jun 2013 16:33:37 +0000 (18:33 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 1 Jul 2013 07:58:25 +0000 (09:58 +0200)
src/libcharon/plugins/ha/ha_tunnel.c
src/libcharon/plugins/stroke/stroke_control.c
src/libcharon/processing/jobs/start_action_job.c
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ikev2/tasks/child_delete.c
src/libcharon/sa/trap_manager.c
src/libcharon/sa/trap_manager.h

index e6a09a7..4e656e7 100644 (file)
@@ -245,7 +245,7 @@ static void setup_tunnel(private_ha_tunnel_t *this,
        charon->backends->add_backend(charon->backends, &this->backend.public);
 
        /* install an acquiring trap */
-       this->trap = charon->traps->install(charon->traps, peer_cfg, child_cfg);
+       this->trap = charon->traps->install(charon->traps, peer_cfg, child_cfg, 0);
 }
 
 METHOD(ha_tunnel_t, destroy, void,
index 91130d1..fdd1635 100644 (file)
@@ -603,7 +603,7 @@ static void charon_route(peer_cfg_t *peer_cfg, child_cfg_t *child_cfg,
        }
        else
        {
-               if (charon->traps->install(charon->traps, peer_cfg, child_cfg))
+               if (charon->traps->install(charon->traps, peer_cfg, child_cfg, 0))
                {
                        fprintf(out, "'%s' routed\n", name);
                }
index bc4aaf6..981473b 100644 (file)
@@ -73,7 +73,7 @@ METHOD(job_t, execute, job_requeue_t,
                                        else
                                        {
                                                charon->traps->install(charon->traps, peer_cfg,
-                                                                                                                         child_cfg);
+                                                                                          child_cfg, 0);
                                        }
                                        break;
                                case ACTION_NONE:
index e251917..22b9e43 100644 (file)
@@ -1575,7 +1575,8 @@ METHOD(ike_sa_t, reestablish, status_t,
                                        break;
                                case ACTION_ROUTE:
                                        charon->traps->install(charon->traps, this->peer_cfg,
-                                                                                  child_sa->get_config(child_sa));
+                                                                                  child_sa->get_config(child_sa),
+                                                                                  child_sa->get_reqid(child_sa));
                                        break;
                                default:
                                        break;
index 9e53d03..5e69677 100644 (file)
@@ -227,7 +227,8 @@ static status_t destroy_and_reestablish(private_child_delete_t *this)
                                        break;
                                case ACTION_ROUTE:
                                        charon->traps->install(charon->traps,
-                                                       this->ike_sa->get_peer_cfg(this->ike_sa), child_cfg);
+                                                       this->ike_sa->get_peer_cfg(this->ike_sa), child_cfg,
+                                                       child_sa->get_reqid(child_sa));
                                        break;
                                default:
                                        break;
index ab638ff..37426fc 100644 (file)
@@ -92,7 +92,8 @@ static void destroy_entry(entry_t *entry)
 }
 
 METHOD(trap_manager_t, install, u_int32_t,
-       private_trap_manager_t *this, peer_cfg_t *peer, child_cfg_t *child)
+       private_trap_manager_t *this, peer_cfg_t *peer, child_cfg_t *child,
+       u_int32_t reqid)
 {
        entry_t *entry, *found = NULL;
        ike_cfg_t *ike_cfg;
@@ -101,7 +102,6 @@ METHOD(trap_manager_t, install, u_int32_t,
        linked_list_t *my_ts, *other_ts, *list;
        enumerator_t *enumerator;
        status_t status;
-       u_int32_t reqid = 0;
 
        /* try to resolve addresses */
        ike_cfg = peer->get_ike_cfg(peer);
index 97de456..0491107 100644 (file)
@@ -37,10 +37,11 @@ struct trap_manager_t {
         *
         * @param peer          peer configuration to initiate on trap
         * @param child         child configuration to install as a trap
+        * @param reqid         optional reqid to use
         * @return                      reqid of installed CHILD_SA, 0 if failed
         */
        u_int32_t (*install)(trap_manager_t *this, peer_cfg_t *peer,
-                                                child_cfg_t *child);
+                                                child_cfg_t *child, u_int32_t reqid);
 
        /**
         * Uninstall a trap policy.