fixed virtual IP re-installation failure in MOBIKE scenarios introduced with changese...
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 17 Nov 2008 00:01:34 +0000 (00:01 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 17 Nov 2008 00:01:34 +0000 (00:01 -0000)
src/charon/sa/child_sa.c

index 82670b0..e7ab356 100644 (file)
@@ -662,6 +662,7 @@ static status_t update_hosts(private_child_sa_t *this,
                                                         host_t *me, host_t *other, host_t *vip, bool encap) 
 {
        child_sa_state_t old;
+       bool transport_proxy_mode;
        
        /* anything changed at all? */
        if (me->equals(me, this->my_addr) && 
@@ -672,8 +673,10 @@ static status_t update_hosts(private_child_sa_t *this,
        
        old = this->state;
        set_state(this, CHILD_UPDATING);
+       transport_proxy_mode = this->config->use_proxy_mode(this->config) &&
+                                                  this->mode == MODE_TRANSPORT;
        
-       if (!this->config->use_proxy_mode(this->config) || this->mode != MODE_TRANSPORT)
+       if (!transport_proxy_mode)
        {
                /* update our (initator) SA */
                if (this->my_spi)
@@ -700,18 +703,6 @@ static status_t update_hosts(private_child_sa_t *this,
                                return NOT_SUPPORTED;
                        }
                }
-
-               /* apply hosts */
-               if (!me->equals(me, this->my_addr))
-               {
-                       this->my_addr->destroy(this->my_addr);
-                       this->my_addr = me->clone(me);
-               }
-               if (!other->equals(other, this->other_addr))
-               {
-                       this->other_addr->destroy(this->other_addr);
-                       this->other_addr = other->clone(other);
-               }
        }
        
        if (this->config->install_policy(this->config))
@@ -779,6 +770,21 @@ static status_t update_hosts(private_child_sa_t *this,
                }
        }
 
+       if (!transport_proxy_mode)
+       {
+               /* apply hosts */
+               if (!me->equals(me, this->my_addr))
+               {
+                       this->my_addr->destroy(this->my_addr);
+                       this->my_addr = me->clone(me);
+               }
+               if (!other->equals(other, this->other_addr))
+               {
+                       this->other_addr->destroy(this->other_addr);
+                       this->other_addr = other->clone(other);
+               }
+       }
+
        this->encap = encap;
        set_state(this, old);