trap-manager: Remove reqid parameter from install() and change return type

Reqids for the same traffic selectors are now stable so we don't have to
pass reqids of previously installed CHILD_SAs.  Likewise, we don't need
to know the reqid of the newly installed trap policy as we now uninstall
by name.
This commit is contained in:
Tobias Brunner
2018-02-22 11:31:05 +01:00
parent f42dd430d8
commit 24fa1bb02a
10 changed files with 22 additions and 146 deletions
+2 -5
View File
@@ -262,7 +262,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, 0);
charon->traps->install(charon->traps, peer_cfg, child_cfg);
}
METHOD(ha_tunnel_t, destroy, void,
@@ -280,10 +280,7 @@ METHOD(ha_tunnel_t, destroy, void,
}
this->creds.local->destroy(this->creds.local);
this->creds.remote->destroy(this->creds.remote);
if (this->trap)
{
charon->traps->uninstall(charon->traps, HA_CFG_NAME, HA_CFG_NAME);
}
charon->traps->uninstall(charon->traps, HA_CFG_NAME, HA_CFG_NAME);
free(this);
}