From 2fe624cca9d0bd47c06c307508d432bf2ea989ba Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 9 Mar 2012 10:03:08 +0100 Subject: [PATCH] Store the peer's current address as additional known address on the IKE_SA. This allows to switch back to the original address after switching to any of the additional addresses. --- src/libcharon/sa/tasks/ike_mobike.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libcharon/sa/tasks/ike_mobike.c b/src/libcharon/sa/tasks/ike_mobike.c index da8834c1d..0539b7d6a 100644 --- a/src/libcharon/sa/tasks/ike_mobike.c +++ b/src/libcharon/sa/tasks/ike_mobike.c @@ -136,6 +136,10 @@ static void process_payloads(private_ike_mobike_t *this, message_t *message) { /* an ADDITIONAL_*_ADDRESS means replace, so flush once */ this->ike_sa->remove_additional_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); + this->ike_sa->add_additional_address(this->ike_sa, + host->clone(host)); } data = notify->get_notification_data(notify); host = host_create_from_chunk(family, data, 0); @@ -152,6 +156,10 @@ static void process_payloads(private_ike_mobike_t *this, message_t *message) case NO_ADDITIONAL_ADDRESSES: { this->ike_sa->remove_additional_addresses(this->ike_sa); + /* add the peer's current address to the list */ + host = this->ike_sa->get_other_host(this->ike_sa); + this->ike_sa->add_additional_address(this->ike_sa, + host->clone(host)); this->addresses_updated = TRUE; break; }