]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ike-config: Ignore unrequested virtual IP addresses
authorTobias Brunner <tobias@strongswan.org>
Thu, 28 Mar 2019 17:44:08 +0000 (18:44 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 4 Apr 2019 09:06:20 +0000 (11:06 +0200)
But forward them to handlers in case they requested them.

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

index 4a8acb97e43f65bb1d87bc4d5459ae76738bfb2e..fdccda5f551a627e8facecca599f36e9cd4e9217 100644 (file)
@@ -41,6 +41,11 @@ struct private_ike_config_t {
         */
        bool initiator;
 
+       /**
+        * Did we request a virtual IP?
+        */
+       bool vip_requested;
+
        /**
         * Received list of virtual IPs, host_t*
         */
@@ -149,6 +154,12 @@ static void process_attribute(private_ike_config_t *this,
                        /* fall */
                case INTERNAL_IP6_ADDRESS:
                {
+                       if (this->initiator && !this->vip_requested)
+                       {
+                               handle_attribute(this, ca);
+                               return;
+                       }
+
                        addr = ca->get_chunk(ca);
                        if (addr.len == 0)
                        {
@@ -270,6 +281,7 @@ METHOD(task_t, build_i, status_t,
                                cp->add_attribute(cp, build_vip(host));
                        }
                        enumerator->destroy(enumerator);
+                       this->vip_requested = TRUE;
                }
 
                enumerator = charon->attributes->create_initiator_enumerator(