]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Add the peer-id to the output of the status command
authorLev Stipakov <lstipakov@gmail.com>
Mon, 8 Dec 2014 17:06:02 +0000 (19:06 +0200)
committerDavid Sommerseth <davids@redhat.com>
Mon, 8 Dec 2014 21:15:08 +0000 (22:15 +0100)
This adds peer-id to the status output which might help analyze floating
logs. This will change the output of status in the same way commit
662ce6acc065bddf6490b3494725b8b3987b7def did.

Signed-off-by: Lev Stipakov <lstipakov@gmail.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: 1418058362-13480-1-git-send-email-lstipakov@gmail.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/9322
Signed-off-by: David Sommerseth <davids@redhat.com>
src/openvpn/multi.c

index 538f4f1b82fb48247e8f505079513108d9a15416..b7785c1aaf2ae894c4fc93a5e98221ece4d1516e 100644 (file)
@@ -815,8 +815,8 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
           */
          status_printf (so, "TITLE%c%s", sep, title_string);
          status_printf (so, "TIME%c%s%c%u", sep, time_string (now, 0, false, &gc_top), sep, (unsigned int)now);
-         status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cVirtual IPv6 Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername%cClient ID",
-                        sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep);
+         status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cVirtual IPv6 Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername%cClient ID%cPeer ID",
+                        sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep);
          hash_iterator_init (m->hash, &hi);
          while ((he = hash_iterator_next (&hi)))
            {
@@ -827,10 +827,11 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
                {
                  status_printf (so, "CLIENT_LIST%c%s%c%s%c%s%c%s%c" counter_format "%c" counter_format "%c%s%c%u%c%s%c"
 #ifdef MANAGEMENT_DEF_AUTH
-                                "%lu",
+                                "%lu"
 #else
-                                "",
+                                ""
 #endif
+                                "%c%"PRIu32,
                                 sep, tls_common_name (mi->context.c2.tls_multi, false),
                                 sep, mroute_addr_print (&mi->real, &gc),
                                 sep, print_in_addr_t (mi->reporting_addr, IA_EMPTY_IF_UNDEF, &gc),
@@ -841,10 +842,11 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
                                 sep, (unsigned int)mi->created,
                                 sep, tls_username (mi->context.c2.tls_multi, false),
 #ifdef MANAGEMENT_DEF_AUTH
-                                sep, mi->context.c2.mda_context.cid);
+                                sep, mi->context.c2.mda_context.cid,
 #else
-                                sep);
+                                sep,
 #endif
+                                sep, mi->context.c2.tls_multi ? mi->context.c2.tls_multi->peer_id : UINT32_MAX);
                }
              gc_free (&gc);
            }