From 555c793afe4f4e377efac3c230333f7af7678fc7 Mon Sep 17 00:00:00 2001 From: 1848 Date: Fri, 25 Oct 2019 23:49:38 +0200 Subject: [PATCH] Add cid to env when calling client-connect and client-disconnect script --- src/openvpn/multi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index d1f9c72e75e..7c421cfa9c4 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -565,6 +565,11 @@ multi_client_disconnect_setenv(struct multi_instance *mi) /* setenv stats */ setenv_stats(&mi->context); +#ifdef MANAGEMENT_DEF_AUTH + /* set cid */ + setenv_long_long(mi->context.c2.es, "cid", mi->context.c2.mda_context.cid); +#endif + /* setenv connection duration */ setenv_long_long(mi->context.c2.es, "time_duration", now - mi->created); } @@ -1761,6 +1766,11 @@ multi_client_connect_setenv(struct multi_context *m, /* setenv client virtual IP address */ multi_set_virtual_addr_env(mi); +#ifdef MANAGEMENT_DEF_AUTH + /* set cid */ + setenv_long_long(mi->context.c2.es, "cid", mi->context.c2.mda_context.cid); +#endif + /* setenv connection time */ { const char *created_ascii = time_string(mi->created, 0, false, &gc);