Fix MOBIKE address update if responder address changed.
authorTobias Brunner <tobias@strongswan.org>
Wed, 9 May 2012 15:53:34 +0000 (17:53 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 25 May 2012 15:05:53 +0000 (17:05 +0200)
Use the source address of the current MOBIKE message as peer address
instead of assuming the address cached on the IKE_SA is still valid.

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

index 3777140..8295bea 100644 (file)
@@ -138,7 +138,7 @@ static void process_payloads(private_ike_mobike_t *this, message_t *message)
                                        this->ike_sa->clear_peer_addresses(this->ike_sa);
                                        first = FALSE;
                                        /* add the peer's current address to the list */
-                                       host = this->ike_sa->get_other_host(this->ike_sa);
+                                       host = message->get_source(message);
                                        this->ike_sa->add_peer_address(this->ike_sa,
                                                                                                   host->clone(host));
                                }
@@ -158,7 +158,7 @@ static void process_payloads(private_ike_mobike_t *this, message_t *message)
                        {
                                this->ike_sa->clear_peer_addresses(this->ike_sa);
                                /* add the peer's current address to the list */
-                               host = this->ike_sa->get_other_host(this->ike_sa);
+                               host = message->get_source(message);
                                this->ike_sa->add_peer_address(this->ike_sa, host->clone(host));
                                this->addresses_updated = TRUE;
                                break;