Skip to contentSkip to conversation

Make received OCC exit messages more visible in log.

PATCH In review Gert Doering 2 participants 3 messages Aug 14, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make received OCC exit messages more visible in log.

Currently, OCC exit messages are only logged at some high debug level (and if OpenVPN compiled with DEBUG), while control-channel EEN messages are logged on verb 1. Make this consistent, both in wording and in log level.

Both messages are prefixed with the "channel" where the exit message came in.

---
 src/openvpn/occ.c  | 2 +-
 src/openvpn/push.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
src/openvpn/occ.c +1 -1
index 8541f6ec..2871449e 100644
@@ -427,7 +427,7 @@ process_received_occ_msg(struct context *c)
             break;
 
         case OCC_EXIT:
-            dmsg(D_PACKET_CONTENT, "RECEIVED OCC_EXIT");
+            dmsg(D_STREAM_ERRORS, "OCC exit message received by peer");
             register_signal(c->sig, SIGUSR1, "remote-exit");
             break;
     }
src/openvpn/push.c +1 -1
index 01e7cd6e..5f5755ab 100644
@@ -190,7 +190,7 @@ server_pushed_signal(struct context *c, const struct buffer *buffer, const bool
 void
 receive_exit_message(struct context *c)
 {
-    dmsg(D_STREAM_ERRORS, "Exit message received by peer");
+    dmsg(D_STREAM_ERRORS, "CC-EEN exit message received by peer");
     /* With control channel exit notification, we want to give the session
      * enough time to handle retransmits and acknowledgment, so that eventual
      * retries from the client to resend the exit or ACKs will not trigger
Signature · 1 line
2.41.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Gert Doering

Currently, OCC exit messages are only logged at some high debug level (and if OpenVPN compiled with DEBUG), while control-channel EEN messages are logged on verb 1. Make this consistent, both in wording and in log level.

Both messages are prefixed with the "channel" where the exit message came in.

Makes sense to me.

Signature · 1 line
  Frank Lichtenheld
#2 lore raw
In reply to Gert Doering

Tested, of course :-) - with a 2.5 client, I now have

2023-08-14 11:26:27 client25 OCC exit message received by peer
2023-08-14 11:26:27 client25 SIGUSR1[soft,remote-exit] received, client-instance restarting

in my server logs.

With a 2.6 client, this becomes:

2023-08-14 11:29:01 client26 CC-EEN exit message received by peer
2023-08-14 11:29:01 client26 Delayed exit in 5 seconds
2023-08-14 11:29:06 client26 SIGTERM[soft,delayed-exit] received, client-instance exiting

(interesting that one does SIGUSR1 and the other does SIGTERM - but for the multi server side it ends up in the same code path "clean up client instance, done")

Patch has been applied to the master and release/2.6 branch.

commit 5f910a42b86e90f1893a668ee280422b6587ada1 (master) commit 6e68d8c5d5304d56de588f4584e2dc6266d2f129 (HEAD -> release/2.6)

Author: Gert Doering
Date:   Mon Aug 14 08:04:09 2023 +0200
     Make received OCC exit messages more visible in log.

     Signed-off-by: Gert Doering <[email protected]...>
     Acked-by: Frank Lichtenheld <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg26949.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering