Bug #14586 » interfaces.inc.patch
| /etc/inc/interfaces.inc 2023-07-18 13:00:23.373239000 +0800 | ||
|---|---|---|
|
}
|
||
|
$iface = $vip['interface'];
|
||
|
$vhid = '';
|
||
|
$mode = '';
|
||
|
if (substr($vip['interface'], 0, 4) == "_vip") {
|
||
|
$carpvip = get_configured_vip($vip['interface']);
|
||
|
$iface = $carpvip['interface'];
|
||
|
$vhid = "vhid {$carpvip['vhid']}";
|
||
|
if (is_ipaddrv4($carpvip['subnet'])) {
|
||
|
$mode = ($carpvip['carp_mode'] == 'ucast' ? "peer ". escapeshellarg($carpvip['carp_peer']) : " mcast");
|
||
|
} else {
|
||
|
$mode = ($carpvip['carp_mode'] == 'ucast' ? "peer6 ". escapeshellarg($carpvip['carp_peer']) : " mcast6");
|
||
|
}
|
||
|
}
|
||
|
mwexec("/sbin/ifconfig " . escapeshellarg($realif) ." {$af} ". escapeshellarg($vip['subnet']) ."/" . escapeshellarg($vip['subnet_bits']) . " alias {$gateway} {$vhid}");
|
||
|
unset($iface, $af, $realif, $carpvip, $vhid, $gateway);
|
||
|
mwexec("/sbin/ifconfig " . escapeshellarg($realif) ." {$af} ". escapeshellarg($vip['subnet']) ."/" . escapeshellarg($vip['subnet_bits']) . " alias {$gateway} {$vhid} {$mode}");
|
||
|
unset($iface, $af, $realif, $carpvip, $vhid, $gateway, $mode);
|
||
|
}
|
||
|
function interface_carp_configure(&$vip, $ipalias_reload = false) {
|
||