From: Tobias Brunner Date: Mon, 2 Oct 2023 14:08:40 +0000 (+0200) Subject: child-delete: Correctly maintain allocated reqid when recreating CHILD_SA X-Git-Tag: 5.9.12rc1~10^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c923022733383a9d1ecbddf3b8ff3eeddd91c050;p=thirdparty%2Fstrongswan.git child-delete: Correctly maintain allocated reqid when recreating CHILD_SA The old CHILD_SA is destroyed even before the new task is queued, this makes sure we always maintain a reference to the reqid. --- diff --git a/src/libcharon/sa/ikev2/tasks/child_delete.c b/src/libcharon/sa/ikev2/tasks/child_delete.c index 54aba2c506..2e2668bbe2 100644 --- a/src/libcharon/sa/ikev2/tasks/child_delete.c +++ b/src/libcharon/sa/ikev2/tasks/child_delete.c @@ -366,7 +366,7 @@ static status_t destroy_and_reestablish(private_child_delete_t *this) spi = child_sa->get_spi(child_sa, TRUE); child_cfg = child_sa->get_config(child_sa); child_cfg->get_ref(child_cfg); - args.reqid = child_sa->get_reqid(child_sa); + args.reqid = child_sa->get_reqid_ref(child_sa); args.label = child_sa->get_label(child_sa); if (args.label) { @@ -391,6 +391,10 @@ static status_t destroy_and_reestablish(private_child_delete_t *this) } } child_cfg->destroy(child_cfg); + if (args.reqid) + { + charon->kernel->release_reqid(charon->kernel, args.reqid); + } DESTROY_IF(args.label); if (status != SUCCESS) {