Refactored the lifetime_cfg_t struct to be simpler and more expressive. Initialization is now static.

This commit is contained in:
Tobias Brunner
2009-09-01 12:54:33 +02:00
parent abff49a7ff
commit e75f423753
12 changed files with 104 additions and 124 deletions
@@ -1844,14 +1844,14 @@ static status_t add_sa(private_kernel_klips_ipsec_t *this,
/* Although KLIPS supports SADB_EXT_LIFETIME_SOFT/HARD, we handle the lifetime
* of SAs manually in the plugin. Refer to the comments in receive_events()
* for details. */
if (lifetime->rekey_time)
if (lifetime->time.rekey)
{
schedule_expire(this, protocol, spi, reqid, EXPIRE_TYPE_SOFT, lifetime->rekey_time);
schedule_expire(this, protocol, spi, reqid, EXPIRE_TYPE_SOFT, lifetime->time.rekey);
}
if (lifetime->life_time)
if (lifetime->time.life)
{
schedule_expire(this, protocol, spi, reqid, EXPIRE_TYPE_HARD, lifetime->life_time);
schedule_expire(this, protocol, spi, reqid, EXPIRE_TYPE_HARD, lifetime->time.life);
}
return SUCCESS;