diff options
Diffstat (limited to 'plugin/eurephia.c')
-rw-r--r-- | plugin/eurephia.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/plugin/eurephia.c b/plugin/eurephia.c index eda014f..880ad71 100644 --- a/plugin/eurephia.c +++ b/plugin/eurephia.c @@ -1,6 +1,6 @@ /* eurephia.c -- Main functions for the eurephia authentication module * - * GPLv2 only - Copyright (C) 2008 - 2010 + * GPLv2 only - Copyright (C) 2008 - 2012 * David Sommerseth <dazo@users.sourceforge.net> * * This program is free software; you can redistribute it and/or @@ -142,10 +142,10 @@ eurephiaCTX *eurephiaInit(const char const **argv, const char const **envp) eurephia_log_init(ctx, "eurephia-auth", logfile, loglvl); } eurephia_log(ctx, LOG_INFO, 0, "Initialising eurephia v" EUREPHIAVERSION - " (David Sommerseth (C) 2008-2010 GPLv2)"); + " (David Sommerseth (C) 2008-2012 GPLv2)"); // Load the database driver - if( (error == 0) && eDBlink_init(ctx, dbi, 1) ) { + if( (error == 0) && eDBlink_init(ctx, dbi, 3) ) { // Connect to the database if( !eDBconnect(ctx, dbargc, dbargv) ) { eurephia_log(ctx, LOG_PANIC, 0, "Could not connect to the database"); @@ -699,12 +699,11 @@ int eurephia_learn_address(eurephiaCTX *ctx, const char *mode, const char *clien goto exit; } - if( ctx->tuntype == tuntype_TAP ) { - // Update openvpn_lastlog with the active MAC address, and save it as a session variable - ret = eDBregister_vpnmacaddr(ctx, session, clientaddr); - } else { - ret = 1; - } + // Update openvpn_lastlog with the active VPN client addresses, and save it as a + // session variable. clientaddr will contain the MAC address in TAP mode + ret = eDBregister_vpnclientaddr(ctx, session, + (ctx->tuntype == tuntype_TAP ? clientaddr : NULL), + vpnipaddr, NULL); if( (fw_enabled) && (fwdest != NULL) ) { fwprofile = eDBget_firewall_profile(ctx, session); |