some cleanups
[strongswan.git] / src / charon / sa / tasks / ike_config.c
index b6e883b..bddd39b 100644 (file)
@@ -300,12 +300,12 @@ static status_t build_r(private_ike_config_t *this, message_t *message)
                        
                        DBG1(DBG_IKE, "peer requested virtual IP %H", this->virtual_ip);
                        ip = this->policy->get_virtual_ip(this->policy, this->virtual_ip);
-                       if (ip == NULL)
+                       if (ip == NULL || ip->is_anyaddr(ip))
                        {
                                DBG1(DBG_IKE, "not assigning a virtual IP to peer");
                                return SUCCESS;
                        }
-                               DBG1(DBG_IKE, "assigning virtual IP %H to peer", ip);
+                       DBG1(DBG_IKE, "assigning virtual IP %H to peer", ip);
                        this->ike_sa->set_virtual_ip(this->ike_sa, FALSE, ip);
                        
                        this->virtual_ip->destroy(this->virtual_ip);
@@ -348,7 +348,10 @@ static status_t process_i(private_ike_config_t *this, message_t *message)
                        
                        while (this->dns->remove_last(this->dns, (void**)&ip) == SUCCESS)
                        {
-                               this->ike_sa->add_dns_server(this->ike_sa, ip);
+                               if (!ip->is_anyaddr(ip))
+                               {
+                                       this->ike_sa->add_dns_server(this->ike_sa, ip);
+                               }
                                ip->destroy(ip);
                        }
                }