From: Tobias Brunner Date: Wed, 9 May 2012 15:53:34 +0000 (+0200) Subject: Fix MOBIKE address update if responder address changed. X-Git-Tag: 5.0.0~205 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53915f14ae7d820dd4f2fbc19a8dc29beec9dc24;p=thirdparty%2Fstrongswan.git Fix MOBIKE address update if responder address changed. 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. --- diff --git a/src/libcharon/sa/ikev2/tasks/ike_mobike.c b/src/libcharon/sa/ikev2/tasks/ike_mobike.c index 377714023c..8295bea0af 100644 --- a/src/libcharon/sa/ikev2/tasks/ike_mobike.c +++ b/src/libcharon/sa/ikev2/tasks/ike_mobike.c @@ -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;