mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
CARP, kill vague advskew legacy hook when starting in maintenance mode (virtualip_carp_maintenancemode), closes https://github.com/opnsense/core/issues/3671
This commit is contained in:
parent
55ae9124c0
commit
28cc0dc5f4
@ -1708,12 +1708,7 @@ function interface_carp_configure(&$vip)
|
||||
$advbase = "advbase " . escapeshellarg($vip['advbase']);
|
||||
}
|
||||
|
||||
$carp_maintenancemode = isset($config["virtualip_carp_maintenancemode"]);
|
||||
if ($carp_maintenancemode) {
|
||||
$advskew = "advskew 254";
|
||||
} else {
|
||||
$advskew = "advskew " . escapeshellarg($vip['advskew']);
|
||||
}
|
||||
$advskew = "advskew " . escapeshellarg($vip['advskew']);
|
||||
|
||||
mwexec("/sbin/ifconfig {$realif} vhid " . escapeshellarg($vip['vhid']) . " {$advskew} {$advbase} {$password}");
|
||||
|
||||
|
||||
10
src/etc/rc.syshook.d/early/98_carp_maintenance
Executable file
10
src/etc/rc.syshook.d/early/98_carp_maintenance
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# when virtualip_carp_maintenancemode is set, make sure we startup in demoted state
|
||||
if [ -f /conf/config.xml ]; then
|
||||
IS_MNT=`grep -c virtualip_carp_maintenancemode /conf/config.xml`
|
||||
IS_DEMOTED=`/sbin/sysctl net.inet.carp.demotion | /usr/bin/awk '{print $2;}'`
|
||||
if [ $IS_MNT -gt 0 ] && [ $IS_DEMOTED -eq -0 ]; then
|
||||
/sbin/sysctl net.inet.carp.demotion=240
|
||||
fi
|
||||
fi
|
||||
Loading…
x
Reference in New Issue
Block a user