From 1776d19e58ed1b2ed350d044572edf350344315e Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 8 Jan 2015 10:40:44 -0500 Subject: Change OpenVPN CARP VIP test to be more accurate. The client should also not be run if the VIP is in the INIT state. --- etc/inc/openvpn.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'etc') diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index 2495cde..3bdb5a6 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -865,14 +865,14 @@ function openvpn_restart($mode, $settings) { return; /* Do not start a client if we are a CARP backup on this vip! */ - if (($mode == "client") && (strstr($settings['interface'], "_vip") && get_carp_interface_status($settings['interface']) == "BACKUP")) + if (($mode == "client") && (strstr($settings['interface'], "_vip") && get_carp_interface_status($settings['interface']) != "MASTER")) return; /* Check if client is bound to a gateway group */ $a_groups = return_gateway_groups_array(); if (is_array($a_groups[$settings['interface']])) { /* the interface is a gateway group. If a vip is defined and its a CARP backup then do not start */ - if (($a_groups[$settings['interface']][0]['vip'] <> "") && (get_carp_interface_status($a_groups[$settings['interface']][0]['vip']) == "BACKUP")) + if (($a_groups[$settings['interface']][0]['vip'] <> "") && (get_carp_interface_status($a_groups[$settings['interface']][0]['vip']) != "MASTER")) return; } -- cgit v1.1