if (inbound)
{
- if (this->my_spi && this->inbound_installed)
+ if (this->inbound_installed)
{
kernel_ipsec_sa_id_t id = {
.src = this->other_addr,
}
else
{
- if (this->other_spi && (this->outbound_state & CHILD_OUTBOUND_SA))
+ if (this->outbound_state & CHILD_OUTBOUND_SA)
{
kernel_ipsec_sa_id_t id = {
.src = this->my_addr,
this->my_cpi = cpi;
dst_ts = my_ts;
src_ts = other_ts;
- this->inbound_installed = TRUE;
}
else
{
{
tfc = this->config->get_tfc(this->config);
}
- this->outbound_state |= CHILD_OUTBOUND_SA;
}
DBG2(DBG_CHD, "adding %s %N SA", inbound ? "inbound" : "outbound",
other_ts->destroy(other_ts);
free(lifetime);
+ if (status == SUCCESS)
+ {
+ if (inbound)
+ {
+ this->inbound_installed = TRUE;
+ }
+ else
+ {
+ this->outbound_state |= CHILD_OUTBOUND_SA;
+ }
+ }
return status;
}
bool encap, uint32_t reqid)
{
/* update our (initiator) SA */
- if (this->my_spi && this->inbound_installed)
+ if (this->inbound_installed)
{
kernel_ipsec_sa_id_t id = {
.src = this->other_addr,
}
/* update his (responder) SA */
- if (this->other_spi && (this->outbound_state & CHILD_OUTBOUND_SA))
+ if (this->outbound_state & CHILD_OUTBOUND_SA)
{
kernel_ipsec_sa_id_t id = {
.src = this->my_addr,
};
charon->kernel->del_sa(charon->kernel, &id, &sa);
}
- if (this->other_spi && (this->outbound_state & CHILD_OUTBOUND_SA))
+ if (this->outbound_state & CHILD_OUTBOUND_SA)
{
kernel_ipsec_sa_id_t id = {
.src = this->my_addr,