diff options
author | Martin Willi <martin@strongswan.org> | 2007-09-12 07:14:05 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2007-09-12 07:14:05 +0000 |
commit | 12fa4387c6f1c3a3d10b4922c1e5e1f172d71af0 (patch) | |
tree | 68ed6413d57c4237db0cd429b34849fd7cf2e2b4 /src/charon | |
parent | 39cc6d1ad74d90dca3873a3266f8ab7fda0409c2 (diff) | |
download | strongswan-12fa4387c6f1c3a3d10b4922c1e5e1f172d71af0.tar.bz2 strongswan-12fa4387c6f1c3a3d10b4922c1e5e1f172d71af0.tar.xz |
fixed NAT detection with mobike
Diffstat (limited to 'src/charon')
-rw-r--r-- | src/charon/sa/tasks/ike_mobike.c | 2 | ||||
-rw-r--r-- | src/charon/sa/tasks/ike_natd.c | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/charon/sa/tasks/ike_mobike.c b/src/charon/sa/tasks/ike_mobike.c index 8d35d966b..9ed32cdc9 100644 --- a/src/charon/sa/tasks/ike_mobike.c +++ b/src/charon/sa/tasks/ike_mobike.c @@ -422,6 +422,7 @@ static status_t process_i(private_ike_mobike_t *this, message_t *message) /* start the update with the same task */ this->check = FALSE; this->address = FALSE; + this->natd = ike_natd_create(this->ike_sa, this->initiator); this->ike_sa->set_pending_updates(this->ike_sa, 1); return NEED_MORE; } @@ -438,7 +439,6 @@ static void roam(private_ike_mobike_t *this, bool address) { this->check = TRUE; this->address = address; - this->natd = ike_natd_create(this->ike_sa, this->initiator); this->ike_sa->set_pending_updates(this->ike_sa, this->ike_sa->get_pending_updates(this->ike_sa) + 1); } diff --git a/src/charon/sa/tasks/ike_natd.c b/src/charon/sa/tasks/ike_natd.c index 9af12e395..3c530d218 100644 --- a/src/charon/sa/tasks/ike_natd.c +++ b/src/charon/sa/tasks/ike_natd.c @@ -147,8 +147,8 @@ static void process_payloads(private_ike_natd_t *this, message_t *message) /* Precompute NAT-D hashes for incoming NAT notify comparison */ ike_sa_id = message->get_ike_sa_id(message); - me = this->ike_sa->get_my_host(this->ike_sa); - other = this->ike_sa->get_other_host(this->ike_sa); + me = message->get_destination(message); + other = message->get_source(message); dst_hash = generate_natd_hash(this, ike_sa_id, me); src_hash = generate_natd_hash(this, ike_sa_id, other); @@ -252,7 +252,7 @@ static status_t build_i(private_ike_natd_t *this, message_t *message) host_t *host; /* destination is always set */ - host = this->ike_sa->get_other_host(this->ike_sa); + host = message->get_destination(message); notify = build_natd_payload(this, NAT_DETECTION_DESTINATION_IP, host); message->add_payload(message, (payload_t*)notify); @@ -261,7 +261,7 @@ static status_t build_i(private_ike_natd_t *this, message_t *message) * 2. We do a routing lookup in the kernel interface * 3. Include all possbile addresses */ - host = this->ike_sa->get_my_host(this->ike_sa); + host = message->get_source(message); if (!host->is_anyaddr(host)) { /* 1. */ notify = build_natd_payload(this, NAT_DETECTION_SOURCE_IP, host); @@ -312,11 +312,11 @@ static status_t build_r(private_ike_natd_t *this, message_t *message) if (this->src_seen && this->dst_seen) { /* initiator seems to support NAT detection, add response */ - me = this->ike_sa->get_my_host(this->ike_sa); + me = message->get_source(message); notify = build_natd_payload(this, NAT_DETECTION_SOURCE_IP, me); message->add_payload(message, (payload_t*)notify); - other = this->ike_sa->get_other_host(this->ike_sa); + other = message->get_destination(message); notify = build_natd_payload(this, NAT_DETECTION_DESTINATION_IP, other); message->add_payload(message, (payload_t*)notify); } |