Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cid to env when calling client-connect and client-disconnect script #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/openvpn/multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down