]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
ike-mobike: Make task a no-op if MOBIKE is not supported
authorTobias Brunner <tobias@strongswan.org>
Mon, 31 Jan 2022 13:13:02 +0000 (14:13 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 15 Feb 2022 15:09:26 +0000 (16:09 +0100)
This allows queuing such a task before IKE_AUTH has been processed.

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

index 283ffd082abd05d3cba97b1fe7edadb292bbc501..092e685acc548fd85f1e10a481a03ab4e14d138e 100644 (file)
@@ -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,