From 90b1d09e42a93736dc1af2f708c9117dfac07593 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 31 Jan 2022 14:13:02 +0100 Subject: [PATCH] ike-mobike: Make task a no-op if MOBIKE is not supported This allows queuing such a task before IKE_AUTH has been processed. --- src/libcharon/sa/ikev2/tasks/ike_mobike.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libcharon/sa/ikev2/tasks/ike_mobike.c b/src/libcharon/sa/ikev2/tasks/ike_mobike.c index 283ffd082..092e685ac 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, -- 2.47.3