Project

General

Profile

« Previous | Next » 

Revision 985118b8

Added by Luiz Souza over 9 years ago

Simplify the code with the use the newly introduced function to list CARP addresses.

View differences:

src/etc/inc/interfaces.inc
2160 2160
		mwexec("/sbin/ifconfig pfsync0 -syncdev -syncpeer down", false);
2161 2161
	}
2162 2162

  
2163
	if ($config['virtualip']['vip']) {
2163
	$carplist = get_configured_vip_list('all', VIP_CARP);
2164
	if (isset($carplist) && is_array($carplist) && count($carplist) > 0) {
2164 2165
		set_single_sysctl("net.inet.carp.allow", "1");
2165 2166
	} else {
2166 2167
		set_single_sysctl("net.inet.carp.allow", "0");
src/usr/local/www/firewall_virtual_ip_edit.php
324 324
	$list = array();
325 325

  
326 326
	$interfaces = get_configured_interface_with_descr(false, true);
327
	$carplist = get_configured_vip_list();
327
	$carplist = get_configured_vip_list('all', VIP_CARP);
328 328

  
329 329
	foreach ($carplist as $vipname => $address) {
330
		$vip = get_configured_vip($vipname);
331
		if ($vip['mode'] != 'carp') {
332
			continue;
333
		}
334

  
335 330
		$interfaces[$vipname] = $address;
336 331
		$interfaces[$vipname] .= " (";
337 332
		if (get_vip_descr($address)) {
338 333
			$interfaces[$vipname] .= get_vip_descr($address);
339 334
		} else {
335
			$vip = get_configured_vip($vipname);
340 336
			$interfaces[$vipname] .= "vhid: {$vip['vhid']}";
341 337
		}
342 338
		$interfaces[$vipname] .= ")";

Also available in: Unified diff