diff options
Diffstat (limited to 'plugin/eurephia-auth.c')
-rw-r--r-- | plugin/eurephia-auth.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugin/eurephia-auth.c b/plugin/eurephia-auth.c index 71969e5..9245a40 100644 --- a/plugin/eurephia-auth.c +++ b/plugin/eurephia-auth.c @@ -270,6 +270,14 @@ OPENVPN_EXPORT int openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, case OPENVPN_PLUGIN_CLIENT_DISCONNECT: // Register logout result = eurephia_disconnect(ctx, envp); + if( (result == 1) && (ctx->tuntype == tuntype_TUN) ) { + // If running in TUN mode, OPENVPN_PLUGIN_LEARN_ADDRESS will not be called, + // so we fake this call here instead. + char *vpnipaddr = GETENV_POOLIPADDR(ctx, envp); + + result = (vpnipaddr ? eurephia_learn_address(ctx, "delete", vpnipaddr, envp) : 0); + free_nullsafe(ctx, vpnipaddr); + } break; case OPENVPN_PLUGIN_LEARN_ADDRESS: // Log IP address, MAC address and update firewall |