Permalink
Browse files

Merge pull request #793 from shahidsheikh/master

Fix #3174 Handling of gateway groups in openvpn_restart()
  • Loading branch information...
2 parents 32a9eb1 + 330ecea commit fcb5121d6fa41e9858beb3111de24e56b0b49c07 Chris Buechler committed Sep 3, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 etc/inc/openvpn.inc
View
@@ -789,6 +789,14 @@ function openvpn_restart($mode, $settings) {
/* 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"))
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"))
+ return;
+ }
/* start the new process */
$fpath = $g['varetc_path']."/openvpn/{$mode_id}.conf";

0 comments on commit fcb5121

Please sign in to comment.