From 78b2a705de9fe698709356e25505d0cabf839ffe Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sun, 29 Sep 2013 05:42:46 -0700 Subject: Fix logic inn detecting if OpenVPN resync needed Commit https://github.com/pfsense/pfsense/commit/f33dcc5c79c54af7daf91a81cfdd7f489e8cb67c reversed the logic sequence when testing if $resync_needed - the individual tests were changed from "==" to "!=" and so on, but the conjunction also need to be changed - "or" needs to be "and". I had noticed that VPNs on some gateway groups of mine didn't failover recently, but hadn't gone looking for the problem until now. This might help bug #3243 - it will probably now make the OpenVPN resync on every interface/gateway change for the cases of CARP VIPs and VLANs mentioned in that bug report. At least that will be better than not resyncing at all. --- etc/rc.openvpn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/rc.openvpn b/etc/rc.openvpn index f60ad56..857dee2 100755 --- a/etc/rc.openvpn +++ b/etc/rc.openvpn @@ -51,7 +51,7 @@ function openvpn_resync_if_needed ($mode, $ovpn_settings, $interface) { $new_device = get_failover_interface($ovpn_settings['interface']); if (isset($config['interfaces'][$interface])) { $this_device = $config['interfaces'][$interface]['if']; - if (($current_device == $new_device) || ($current_device != $this_device) || ($new_device != $this_device)) + if (($current_device == $new_device) && ($current_device != $this_device) && ($new_device != $this_device)) $resync_needed = false; } } -- cgit v1.1