VPN: OpenVPN: Clients - When receiving carp events for client mode openvpn instances, treat INIT the same as BACKUP as both modes aren't active. experiment for https://github.com/opnsense/core/issues/6506

This commit is contained in:
Ad Schellevis 2023-04-19 08:55:04 +02:00
parent 8f9d7e823b
commit e2a1e8c312
2 changed files with 3 additions and 3 deletions

View File

@ -917,9 +917,9 @@ function openvpn_restart($mode, $settings, $carp_event = false)
$interface_details = legacy_interface_details(get_real_interface($interface));
if (
!empty($interface_details) && !empty($interface_details['carp'][$vhid]) &&
$interface_details['carp'][$vhid]['status'] == 'BACKUP'
in_array($interface_details['carp'][$vhid]['status'], ['BACKUP' ,'INIT'])
) {
/* do not restart a client if we are a CARP backup instance */
/* do not restart a client if we are a CARP backup instance or unplugged (init)*/
return;
}
}

View File

@ -35,7 +35,7 @@ require_once("plugins.inc.d/openvpn.inc");
$subsystem = !empty($argv[1]) ? $argv[1] : '';
$type = !empty($argv[2]) ? $argv[2] : '';
if ($type != 'MASTER' && $type != 'BACKUP') {
if (!in_array($type, ['MASTER', 'BACKUP', 'INIT'])) {
log_msg("Carp '$type' event unknown from source '{$subsystem}'");
exit(1);
}