Hi Ian,

> Currently when the IKE SA is destroyed (ike_sa->destroy) I see that the
> in the call to DESTROY_IF(this->peer_cfg) that the refcount is 2 (as a
> result of the call to ike_sa->set_peer_cfg) so does not get deleted at
> this time and is in fact never released. 

ike_sa->set_peer_cfg() takes a reference, so you can destroy() it to
release the reference as soon as you have passed it to set_peer_cfg().

Alternatively, you can use the control wrapper functionality provided by
controller_t. The initiate() method automatically consumes a reference
to the passed config.

Regards
Martin


_______________________________________________
Dev mailing list
[email protected]
https://lists.strongswan.org/mailman/listinfo/dev

Reply via email to