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);