*/
child_sa_outbound_state_t outbound_state;
+ /**
+ * Whether the inbound SA has been installed
+ */
+ bool inbound_installed;
+
/**
* Whether the peer supports TFCv3
*/
if (inbound)
{
- if (this->my_spi)
+ if (this->my_spi && this->inbound_installed)
{
kernel_ipsec_sa_id_t id = {
.src = this->other_addr,
this->my_cpi = cpi;
dst_ts = my_ts;
src_ts = other_ts;
+ this->inbound_installed = TRUE;
}
else
{
bool encap)
{
/* update our (initiator) SA */
- if (this->my_spi)
+ if (this->my_spi && this->inbound_installed)
{
kernel_ipsec_sa_id_t id = {
.src = this->other_addr,
}
/* delete SAs in the kernel, if they are set up */
- if (this->my_spi)
+ if (this->my_spi && this->inbound_installed)
{
kernel_ipsec_sa_id_t id = {
.src = this->other_addr,