From: Tobias Brunner Date: Mon, 31 Jan 2022 13:13:02 +0000 (+0100) Subject: ike-mobike: Make task a no-op if MOBIKE is not supported X-Git-Tag: 5.9.6rc1~22^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90b1d09e42a93736dc1af2f708c9117dfac07593;p=thirdparty%2Fstrongswan.git ike-mobike: Make task a no-op if MOBIKE is not supported This allows queuing such a task before IKE_AUTH has been processed. --- diff --git a/src/libcharon/sa/ikev2/tasks/ike_mobike.c b/src/libcharon/sa/ikev2/tasks/ike_mobike.c index 283ffd082a..092e685acc 100644 --- a/src/libcharon/sa/ikev2/tasks/ike_mobike.c +++ b/src/libcharon/sa/ikev2/tasks/ike_mobike.c @@ -375,6 +375,14 @@ METHOD(task_t, build_i, status_t, { host_t *old, *new; + /* this task might have been queued before we knew if MOBIKE will be + * supported */ + if (!this->ike_sa->supports_extension(this->ike_sa, EXT_MOBIKE)) + { + message->set_exchange_type(message, EXCHANGE_TYPE_UNDEFINED); + return SUCCESS; + } + /* we check if the existing address is still valid */ old = message->get_source(message); new = charon->kernel->get_source_addr(charon->kernel,