[Openvpn-devel,v1] improve float collision logging

Message ID 20250718191702.9451-1-gert@greenie.muc.de
State New
Headers show
Series [Openvpn-devel,v1] improve float collision logging | expand

Commit Message

Gert Doering July 18, 2025, 7:16 p.m. UTC
From: Ralf Lici <ralf@mandelbit.com>

Extend the log message printed when an instance floats to an address
already taken by another instance with the same certificate. The updated
message now includes the instance being closed, the reason it's being
closed, and the new instance taking over that address.

Change-Id: I217cfb319b85fd75a88f7d4d50c374d28771df28
Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1091
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>

Comments

Gert Doering July 18, 2025, 7:21 p.m. UTC | #1
Just a small commit but would have saved us a few hours staring at logs
today - due to a different bug, the floating code would try to "float to
itself", find "that ip+port is already in use", kill 'that' instance
(itself), and then crash on "where did my instance go?"...  and we just
got an ominous "closing instance" with no reason.

Verified that triggering the (already fixed) bug with the new message
would produce a nicer and more helpful message.  Good :-)

Your patch has been applied to the master branch.

commit 495e02e675a1c64ac902428ac82f6b1bfd35ed25
Author: Ralf Lici
Date:   Fri Jul 18 21:16:56 2025 +0200

     improve float collision logging

     Signed-off-by: Ralf Lici <ralf@mandelbit.com>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20250718191702.9451-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32226.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
index ead3dd0..4696686 100644
--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -3263,7 +3263,11 @@ 
                 mroute_addr_print(&mi->real, &gc));
             goto done;
         }
-        msg(D_MULTI_MEDIUM, "closing instance %s", multi_instance_string(ex_mi, false, &gc));
+
+        msg(D_MULTI_LOW, "closing instance %s due to float collision with %s "
+            "using the same certificate",
+            multi_instance_string(ex_mi, false, &gc),
+            multi_instance_string(mi, false, &gc));
         multi_close_instance(m, ex_mi, false);
     }