aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-02-22 14:55:03 +0100
committerMartin Willi <martin@revosec.ch>2013-03-01 11:26:47 +0100
commit21dd4c4beab5b3e61dba28eedbc7aad375bdf0a3 (patch)
tree9aa3520cc9b60df4fdfb93412eabce3af7b7108c /src
parent00683b686456383a83e7500e19a24a83eccd7314 (diff)
downloadstrongswan-21dd4c4beab5b3e61dba28eedbc7aad375bdf0a3.tar.bz2
strongswan-21dd4c4beab5b3e61dba28eedbc7aad375bdf0a3.tar.xz
Without MOBIKE, update remote host only if it is behind NAT
Diffstat (limited to 'src')
-rw-r--r--src/libcharon/sa/ike_sa.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c
index ea15ff2ca..0157599c1 100644
--- a/src/libcharon/sa/ike_sa.c
+++ b/src/libcharon/sa/ike_sa.c
@@ -900,7 +900,7 @@ METHOD(ike_sa_t, update_hosts, void,
else
{
/* update our address in any case */
- if (!me->equals(me, this->my_host))
+ if (force && !me->equals(me, this->my_host))
{
set_my_host(this, me->clone(me));
update = TRUE;
@@ -909,7 +909,8 @@ METHOD(ike_sa_t, update_hosts, void,
if (!other->equals(other, this->other_host))
{
/* update others address if we are NOT NATed */
- if (force || !has_condition(this, COND_NAT_HERE))
+ if ((has_condition(this, COND_NAT_THERE) &&
+ !has_condition(this, COND_NAT_HERE)) || force )
{
set_other_host(this, other->clone(other));
update = TRUE;