controller: Properly notify waiting thread after INVALID_KE_PAYLOAD retry failed

When initiating a Child SA with a CREATE_CHILD_SA exchange, the initial
exchange could fail with an INVALID_KE_PAYLOAD notify.  The initiation
would then get retried from scratch (the `child_sa_t` object is destroyed
and a new one created).  If it fails again, the previous code didn't
signal the waiting thread.  If it did not set a timeout, it would wait
indefinitely.

Using a different `status_t` value avoids any confusion with NEED_MORE
that's used to indicate that the callback returned FALSE (e.g. if the
IKE_SA would go down before concluding the retry).

Fixes: c39b0c883d ("controller: Keep following initiate() if the first DH guess was wrong")
This commit is contained in:
Tobias Brunner
2026-07-23 10:26:08 +02:00
parent a885a3da60
commit cef4bce3e1
+2 -3
View File
@@ -341,13 +341,12 @@ METHOD(listener_t, child_state_change, bool,
case CHILD_RETRYING:
/* retrying with a different DH group; survive another
* initiation round */
this->status = NEED_MORE;
this->status = INVALID_ARG;
return TRUE;
case CHILD_CREATED:
if (this->status == NEED_MORE)
if (this->status == INVALID_ARG)
{
this->status = FAILED;
return TRUE;
}
break;
default: