If WTMP support was enabled at compile time and activated in configuration call wtmp_*() functions at startup and connection startup/end. -- multi.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/multi.c b/multi.c index fa924f1..2977029 100644 --- a/multi.c +++ b/multi.c @@ -42,6 +42,10 @@ #include "forward-inline.h" +#ifdef ENABLE_WTMP +#include "wtmp.h" +#endif + /*#define MULTI_DEBUG_EVENT_LOOP*/ #ifdef MULTI_DEBUG_EVENT_LOOP @@ -457,6 +461,11 @@ multi_close_instance (struct multi_context *m, dmsg (D_MULTI_DEBUG, "MULTI: multi_close_instance called"); +#ifdef ENABLE_WTMP + if (m->top.options.log_wtmp) + wtmp_stop (mi); +#endif + /* prevent dangling pointers */ if (m->pending == mi) multi_set_pending (m, NULL); @@ -1444,6 +1453,14 @@ multi_connection_established (struct multi_context *m, struct multi_instance *mi } #endif +#ifdef ENABLE_WTMP + if (m->top.options.log_wtmp) + { + mi->context.c1.wtmp_line = gen_wtmp_line (); + wtmp_start (mi); + } +#endif + /* * Run --client-connect script. */ @@ -2289,6 +2306,11 @@ tunnel_server (struct context *top) { ASSERT (top->options.mode == MODE_SERVER); +#ifdef ENABLE_WTMP + if (top->options.log_wtmp) + wtmp_init (&top->options); +#endif + switch (top->options.proto) { case PROTO_UDPv4: tunnel_server_udp (top);