]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
child-create: Trigger CHILD_INSTALLING event after setting traffic selectors
authorTobias Brunner <tobias@strongswan.org>
Mon, 24 Mar 2025 16:56:46 +0000 (17:56 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 28 May 2025 08:11:53 +0000 (10:11 +0200)
This was the case before bce0c5fd74a0 ("child-create: Update CHILD_SA IP
addresses before installation") and allows listeners to consider the
traffic selectors of the SA that's about to get installed.

src/libcharon/sa/ikev2/tasks/child_create.c

index 5cf738f5307a399ee335d2906f1f0a5e92f50f64..be4662f1c0d91b2c68e5f8cffe90aa2eb2bb496e 100644 (file)
@@ -653,7 +653,6 @@ static status_t install_child_sa(private_child_create_t *this)
        this->child_sa->set_mode(this->child_sa, this->mode);
        this->child_sa->set_protocol(this->child_sa,
                                                                 this->proposal->get_protocol(this->proposal));
-       this->child_sa->set_state(this->child_sa, CHILD_INSTALLING);
 
        /* addresses might have changed since we originally sent the request, update
         * them before we configure any policies and install the SAs */
@@ -670,6 +669,7 @@ static status_t install_child_sa(private_child_create_t *this)
                other_ts->destroy_offset(other_ts,
                                                          offsetof(traffic_selector_t, destroy));
        }
+       this->child_sa->set_state(this->child_sa, CHILD_INSTALLING);
 
        if (this->my_cpi == 0 || this->other_cpi == 0 || this->ipcomp == IPCOMP_NONE)
        {