Reuse reqid for trap policies installed for dpd|closeaction=hold

This commit is contained in:
Tobias Brunner
2013-07-01 09:58:25 +02:00
committed by Andreas Steffen
parent 156e552caf
commit 4c74fa664b
7 changed files with 11 additions and 8 deletions
+1 -1
View File
@@ -245,7 +245,7 @@ static void setup_tunnel(private_ha_tunnel_t *this,
charon->backends->add_backend(charon->backends, &this->backend.public); charon->backends->add_backend(charon->backends, &this->backend.public);
/* install an acquiring trap */ /* 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, METHOD(ha_tunnel_t, destroy, void,
@@ -603,7 +603,7 @@ static void charon_route(peer_cfg_t *peer_cfg, child_cfg_t *child_cfg,
} }
else 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); fprintf(out, "'%s' routed\n", name);
} }
@@ -73,7 +73,7 @@ METHOD(job_t, execute, job_requeue_t,
else else
{ {
charon->traps->install(charon->traps, peer_cfg, charon->traps->install(charon->traps, peer_cfg,
child_cfg); child_cfg, 0);
} }
break; break;
case ACTION_NONE: case ACTION_NONE:
+2 -1
View File
@@ -1575,7 +1575,8 @@ METHOD(ike_sa_t, reestablish, status_t,
break; break;
case ACTION_ROUTE: case ACTION_ROUTE:
charon->traps->install(charon->traps, this->peer_cfg, 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; break;
default: default:
break; break;
+2 -1
View File
@@ -227,7 +227,8 @@ static status_t destroy_and_reestablish(private_child_delete_t *this)
break; break;
case ACTION_ROUTE: case ACTION_ROUTE:
charon->traps->install(charon->traps, 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; break;
default: default:
break; break;
+2 -2
View File
@@ -92,7 +92,8 @@ static void destroy_entry(entry_t *entry)
} }
METHOD(trap_manager_t, install, u_int32_t, 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; entry_t *entry, *found = NULL;
ike_cfg_t *ike_cfg; 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; linked_list_t *my_ts, *other_ts, *list;
enumerator_t *enumerator; enumerator_t *enumerator;
status_t status; status_t status;
u_int32_t reqid = 0;
/* try to resolve addresses */ /* try to resolve addresses */
ike_cfg = peer->get_ike_cfg(peer); ike_cfg = peer->get_ike_cfg(peer);
+2 -1
View File
@@ -37,10 +37,11 @@ struct trap_manager_t {
* *
* @param peer peer configuration to initiate on trap * @param peer peer configuration to initiate on trap
* @param child child configuration to install as a 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 * @return reqid of installed CHILD_SA, 0 if failed
*/ */
u_int32_t (*install)(trap_manager_t *this, peer_cfg_t *peer, 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. * Uninstall a trap policy.