ike-sa: Log IKE endpoint changes

This commit is contained in:
Tobias Brunner 2021-06-10 16:38:23 +02:00 committed by Andreas Steffen
parent 79b526deba
commit 036ae27645
2 changed files with 20 additions and 2 deletions

View File

@ -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));
}

View File

@ -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 */