Commit ac8eba7d authored by Ad Schellevis's avatar Ad Schellevis

another test

parent bc2765ea
......@@ -1158,18 +1158,6 @@ function interface_reconfigure($interface = 'wan', $reloadall = false)
interface_configure($interface, $reloadall);
}
function interface_vips_bring_down($intf)
{
global $config;
if (!empty($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $vip) {
if ($vip['interface'] == $intf) {
interface_vip_bring_down($vip);
}
}
}
}
function interface_vip_bring_down($vip)
{
$vipif = get_real_interface($vip['interface']);
......@@ -1946,10 +1934,6 @@ function interfaces_vips_configure($interface = '')
if ($interface <> "" && $vip['interface'] <> $interface) {
continue;
}
if (!$carp_setuped) {
// interfaces_carp_setup will enable carp when pfsync completes.
set_single_sysctl("net.inet.carp.allow", "0");
}
if ($carp_setuped == false) {
$carp_setuped = true;
}
......
......@@ -58,9 +58,3 @@ if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-client'
}
}
$pluginparams = array();
$pluginparams['type'] = 'carp';
$pluginparams['event'] = 'rc.carpbackup';
$pluginparams['interface'] = $argv[1];
?>
......@@ -66,9 +66,3 @@ if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-server'
}
}
$pluginparams = array();
$pluginparams['type'] = 'carp';
$pluginparams['event'] = 'rc.carpmaster';
$pluginparams['interface'] = $argv[1];
?>
......@@ -38,6 +38,23 @@ require_once("system.inc");
require_once("unbound.inc");
require_once("services.inc");
/**
* signal CARP to go down when there's a ip configured on the provided interface
* interfaces_carp_setup will enable carp when pfsync completes.
*/
function interface_signal_carp($intf)
{
global $config;
if (!empty($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $vip) {
if ($vip['interface'] == $intf && $vip['mode'] == 'carp') {
set_single_sysctl("net.inet.carp.allow", "0");
}
}
}
}
function handle_argument_group($iface, $argument2) {
global $config;
......@@ -68,7 +85,7 @@ function handle_argument_group($iface, $argument2) {
case "stop":
log_error("DEVD Ethernet detached event for {$iface}");
interface_bring_down($iface);
interface_vips_bring_down($iface);
interface_signal_carp($iface);
break;
case "start":
log_error("DEVD Ethernet attached event for {$iface}");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment