Project

General

Profile

Bug #14586 » interfaces.inc.patch

Patch to correct interface_ipalias_configure() in interfaces.inc - James George, 07/18/2023 05:30 AM

View differences:

/etc/inc/interfaces.inc 2023-07-18 13:00:23.373239000 +0800
3050 3050
	}
3051 3051
	$iface = $vip['interface'];
3052 3052
	$vhid = '';
3053
	$mode = '';
3053 3054
	if (substr($vip['interface'], 0, 4) == "_vip") {
3054 3055
		$carpvip = get_configured_vip($vip['interface']);
3055 3056
		$iface = $carpvip['interface'];
3056 3057
		$vhid = "vhid {$carpvip['vhid']}";
3058
	        if (is_ipaddrv4($carpvip['subnet'])) {
3059
	        	$mode = ($carpvip['carp_mode'] == 'ucast' ? "peer ". escapeshellarg($carpvip['carp_peer']) : " mcast");
3060
	        } else {
3061
	        	$mode = ($carpvip['carp_mode'] == 'ucast' ? "peer6 ". escapeshellarg($carpvip['carp_peer']) : " mcast6");
3062
	        }
3057 3063
	}
3058
	mwexec("/sbin/ifconfig " . escapeshellarg($realif) ." {$af} ". escapeshellarg($vip['subnet']) ."/" . escapeshellarg($vip['subnet_bits']) . " alias {$gateway} {$vhid}");
3059
	unset($iface, $af, $realif, $carpvip, $vhid, $gateway);
3064
	mwexec("/sbin/ifconfig " . escapeshellarg($realif) ." {$af} ". escapeshellarg($vip['subnet']) ."/" . escapeshellarg($vip['subnet_bits']) . " alias {$gateway} {$vhid} {$mode}");
3065
	unset($iface, $af, $realif, $carpvip, $vhid, $gateway, $mode);
3060 3066
}
3061 3067

  
3062 3068
function interface_carp_configure(&$vip, $ipalias_reload = false) {
(1-1/2)