Change in osmo-sysmon[master]: openvpn: log status description

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Fri Mar 15 23:38:44 UTC 2019


Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13285 )

Change subject: openvpn: log status description
......................................................................

openvpn: log status description

Useful specially during RECONNECTING and EXITING to show reason of the
disconnect according to openvpn documentation.

Change-Id: I9f47f5d843bb550a4ce7956c89d31f06394201cf
---
M src/osysmon_openvpn.c
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/osysmon_openvpn.c b/src/osysmon_openvpn.c
index 5ca0c83..672fd51 100644
--- a/src/osysmon_openvpn.c
+++ b/src/osysmon_openvpn.c
@@ -61,7 +61,7 @@
 
 static char *parse_state(struct msgb *msg, struct openvpn_client *vpn)
 {
-	char tmp[128];
+	char tmp[128], buf[128];
 	char *tok;
 	unsigned int i = 0;
 	uint8_t *m = msgb_data(msg);
@@ -85,9 +85,13 @@
 		/* The string format is documented in https://openvpn.net/community-resources/management-interface/ */
 		if (tok) { /* Parse csv string and pick interesting tokens while ignoring the rest. */
 			switch (i++) {
+			/* case 0: unix/date time, not needed */
 			case 1:
 				update_name(vpn->rem_cfg, tok);
 				break;
+			case 2:
+				snprintf(buf, sizeof(buf), "%s (%s)", vpn->rem_cfg->name, tok);
+				update_name(vpn->rem_cfg, buf);
 			case 3:
 				osmo_talloc_replace_string(vpn->rem_cfg, &vpn->tun_ip, tok);
 				break;

-- 
To view, visit https://gerrit.osmocom.org/13285
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sysmon
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9f47f5d843bb550a4ce7956c89d31f06394201cf
Gerrit-Change-Number: 13285
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190315/06ddfdf3/attachment.htm>


More information about the gerrit-log mailing list