From c3e7aeb10275ca1be46be5d22eecc42632801477 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Fri, 25 Aug 2006 07:37:22 +0000 Subject: [PATCH] fixed bug which prevented port float when nat is detected --- src/charon/sa/transactions/ike_sa_init.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/charon/sa/transactions/ike_sa_init.c b/src/charon/sa/transactions/ike_sa_init.c index 6dda7eb14..6f52f42d2 100644 --- a/src/charon/sa/transactions/ike_sa_init.c +++ b/src/charon/sa/transactions/ike_sa_init.c @@ -1005,8 +1005,16 @@ static status_t conclude(private_ike_sa_init_t *this, message_t *response, } if (this->ike_sa->is_natt_enabled(this->ike_sa)) { + /* update host in IKE_SA */ + me = this->ike_sa->get_my_host(this->ike_sa); + me = me->clone(me); me->set_port(me, IKEV2_NATT_PORT); + this->ike_sa->set_my_host(this->ike_sa, me); + other = this->ike_sa->get_other_host(this->ike_sa); + other = other->clone(other); other->set_port(other, IKEV2_NATT_PORT); + this->ike_sa->set_other_host(this->ike_sa, other); + this->logger->log(this->logger, CONTROL|LEVEL1, "switching to port %d", IKEV2_NATT_PORT); } }