From e869f5257bf9cfb1b6a7fdc84aeebada88f39854 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Thu, 8 Jan 2015 20:24:18 +0100 Subject: plugin: Don't treat not found sessions in eurephinalearn_address() as a failure This function is called also with IP adresses from networks behind clients, and eurephia doesn't really need to process them. Signed-off-by: David Sommerseth (cherry picked from commit 31193a9d4f764bd54e00fc9e277c98319f198acd) --- plugin/eurephia.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/eurephia.c b/plugin/eurephia.c index d21b80c..961b083 100644 --- a/plugin/eurephia.c +++ b/plugin/eurephia.c @@ -673,6 +673,10 @@ int eurephia_learn_address(eurephiaCTX *ctx, const char *mode, const char *clien eurephia_log(ctx, LOG_CRITICAL, 0, "No firewall destination defined in the config."); } + // FIXME: Figure out a way to differentiate IP addresses from VPN clients + // and IP adresses behind clients. Only the former needs to be + // processed by eurephia. + // In TUN mode, if a client reconnects quickly after a disconnect, // OpenVPN re-uses the session for this and just sends an update // call to LEARN_ADDRESS. As eurephia in TUN mode treats disconnects @@ -743,7 +747,7 @@ int eurephia_learn_address(eurephiaCTX *ctx, const char *mode, const char *clien } if( session == NULL ) { DEBUG(ctx, 25, "[learn-address] Untracked IP address: %s", clientaddr); - ret = 0; + ret = 1; /* Return success, as this isn't a failure in eurephia */ goto exit; } -- cgit