From 6a3d60d9a8ab6a33b04aad4bf059eab45eac438b Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 3 Dec 2014 21:54:49 +0100 Subject: [PATCH] Correctly push route for local network --- .../e-smith/templates/etc/openvpn/routed/openvpn.conf/70routes | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/root/etc/e-smith/templates/etc/openvpn/routed/openvpn.conf/70routes b/root/etc/e-smith/templates/etc/openvpn/routed/openvpn.conf/70routes index 332da05..2205174 100644 --- a/root/etc/e-smith/templates/etc/openvpn/routed/openvpn.conf/70routes +++ b/root/etc/e-smith/templates/etc/openvpn/routed/openvpn.conf/70routes @@ -19,12 +19,10 @@ elsif ($pushRoutes eq 'enabled'){ my $mask = $network->prop('Mask'); my $gw = $network->prop('Router') || ''; my $vpn = $network->prop('VPN') || ''; - if ($gw ne '') { - $route .= "push \"route $addr $mask"; - $route .= " $gw" if ($vpn eq ''); - $OUT .= "$route\"\n"; - } + next if (($network->prop('VPNRouted') || 'no') eq 'yes'); + $route .= "push \"route $addr $mask"; + $route .= " $gw" if ($vpn eq '' && $gw ne ''); + $OUT .= "$route\"\n"; } } - }