From 036ae27645ab563f80da41bbade9305b449076c8 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Thu, 10 Jun 2021 16:38:23 +0200 Subject: [PATCH] ike-sa: Log IKE endpoint changes --- src/libcharon/sa/ike_sa.c | 20 ++++++++++++++++++++ src/libcharon/sa/ikev2/tasks/ike_mobike.c | 2 -- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c index 51a8442493..407917637c 100644 --- a/src/libcharon/sa/ike_sa.c +++ b/src/libcharon/sa/ike_sa.c @@ -1196,10 +1196,30 @@ METHOD(ike_sa_t, update_hosts, void, } if (new_me) { + if (this->state == IKE_ESTABLISHED) + { + DBG1(DBG_IKE, "local endpoint changed from %#H to %#H", + this->my_host, new_me); + } + else + { + DBG2(DBG_IKE, "local endpoint changed from %#H to %#H", + this->my_host, new_me); + } set_my_host(this, new_me->clone(new_me)); } if (new_other) { + if (this->state == IKE_ESTABLISHED) + { + DBG1(DBG_IKE, "remote endpoint changed from %#H to %#H", + this->other_host, new_other); + } + else + { + DBG2(DBG_IKE, "remote endpoint changed from %#H to %#H", + this->other_host, new_other); + } set_other_host(this, new_other->clone(new_other)); } diff --git a/src/libcharon/sa/ikev2/tasks/ike_mobike.c b/src/libcharon/sa/ikev2/tasks/ike_mobike.c index 81f7d21ae5..b9ba92cd89 100644 --- a/src/libcharon/sa/ikev2/tasks/ike_mobike.c +++ b/src/libcharon/sa/ikev2/tasks/ike_mobike.c @@ -443,8 +443,6 @@ METHOD(task_t, process_r, status_t, other_old = this->ike_sa->get_other_host(this->ike_sa); if (!other->equals(other, other_old)) { - DBG1(DBG_IKE, "remote address changed from %H to %H", other_old, - other); other_new = other; /* our address might have changed too if the responder used * a different address from our list to reach us */ -- 2.47.2