]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ike-sa: Log IKE endpoint changes
authorTobias Brunner <tobias@strongswan.org>
Thu, 10 Jun 2021 14:38:23 +0000 (16:38 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 21 Jun 2021 10:03:36 +0000 (12:03 +0200)
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ikev2/tasks/ike_mobike.c

index 51a84424935e2f82f92b35952a06eace88adff52..407917637c15767c50213f8f7c70605aa51da42b 100644 (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));
                }
 
index 81f7d21ae509afcf55936f35048a5848e394e059..b9ba92cd8904364eb79c2b0bf32b3d212189fa96 100644 (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 */