From: Martin Willi Date: Wed, 3 Apr 2013 13:56:26 +0000 (+0200) Subject: Reuse reqid of an existing Quick Mode, even if it has been rekeyed X-Git-Tag: 5.0.3~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ac48d9e458699aa68f774aaa3168533cf42f95b0;p=thirdparty%2Fstrongswan.git Reuse reqid of an existing Quick Mode, even if it has been rekeyed If two peers rekey Quick Modes at the same time, the original Quick Mode is in REKEYING state and hence the requid is not reused. This is required though, as two identical policies won't work if they have different requids. --- diff --git a/src/libcharon/sa/ikev1/tasks/quick_mode.c b/src/libcharon/sa/ikev1/tasks/quick_mode.c index afdff8cf9d..bb50ca9caa 100644 --- a/src/libcharon/sa/ikev1/tasks/quick_mode.c +++ b/src/libcharon/sa/ikev1/tasks/quick_mode.c @@ -925,7 +925,8 @@ static void check_for_rekeyed_child(private_quick_mode_t *this) enumerator = this->ike_sa->create_child_sa_enumerator(this->ike_sa); while (this->reqid == 0 && enumerator->enumerate(enumerator, &child_sa)) { - if (child_sa->get_state(child_sa) == CHILD_INSTALLED && + if ((child_sa->get_state(child_sa) == CHILD_INSTALLED || + child_sa->get_state(child_sa) == CHILD_REKEYING) && streq(child_sa->get_name(child_sa), this->config->get_name(this->config))) {