[Openvpn-devel,v2,4/4] Log peer-id if loglevel is D_DCO_DEBUG and dco is enabled

Message ID 20221227140249.3524943-6-arne@rfc2549.org
State Superseded
Headers show
Series [Openvpn-devel,1/2] Replace custom min macro and use more C99 style in man_remote_entry_get | expand

Commit Message

Arne Schwabe Dec. 27, 2022, 2:02 p.m. UTC
This enables logging the peer id in p2mp mode if dco is enabled
and the log level is high enough

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---
 src/openvpn/multi.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch

diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
index 50d88f19a..f8366be28 100644
--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -473,6 +473,12 @@  multi_instance_string(const struct multi_instance *mi, bool null, struct gc_aren
             buf_printf(&out, "%s/", cn);
         }
         buf_printf(&out, "%s", mroute_addr_print(&mi->real, gc));
+        if (mi->context.c2.tls_multi
+            && mi->context.options.verbosity >= D_DCO_DEBUG
+            && dco_enabled(&mi->context.options))
+        {
+            buf_printf(&out, " peer-id=%d", mi->context.c2.tls_multi->peer_id);
+        }
         return BSTR(&out);
     }
     else if (null)