Use virtual IP to substitute dynamic traffic selectors in quick mode
authorMartin Willi <martin@revosec.ch>
Fri, 9 Dec 2011 15:19:54 +0000 (16:19 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:17 +0000 (17:31 +0100)
src/libcharon/sa/tasks/quick_mode.c

index 6b6a935..0a625c3 100644 (file)
@@ -296,13 +296,17 @@ static traffic_selector_t* select_ts(private_quick_mode_t *this, bool initiator)
        linked_list_t *list;
        host_t *host;
 
-       if (initiator)
+       host = this->ike_sa->get_virtual_ip(this->ike_sa, initiator);
+       if (!host)
        {
-               host = this->ike_sa->get_my_host(this->ike_sa);
-       }
-       else
-       {
-               host = this->ike_sa->get_other_host(this->ike_sa);
+               if (initiator)
+               {
+                       host = this->ike_sa->get_my_host(this->ike_sa);
+               }
+               else
+               {
+                       host = this->ike_sa->get_other_host(this->ike_sa);
+               }
        }
        list = this->config->get_traffic_selectors(this->config, initiator,
                                                                                           NULL, host);