Project

General

Profile

« Previous | Next » 

Revision 2feb85af

Added by Seth Mos almost 14 years ago

Add a interface_has_gatewayv6() function to determine if a interface has a IPv6 gateway.
Implement that function return_gateways_array() to prevent ghost entries

View differences:

etc/inc/gwlb.inc
371 371

  
372 372
	/* Process/add dynamic v6 gateways. */
373 373
	foreach($iflist as $ifname => $friendly ) {
374
		if(! interface_has_gateway($ifname))
374
		if(! interface_has_gatewayv6($ifname))
375 375
			continue;
376 376

  
377 377
		if (empty($config['interfaces'][$ifname]))
......
412 412
		$gateway['descr'] = "Interface {$friendly} Dynamic Gateway";
413 413
		$gateways_arr[$gateway['name']] = $gateway;
414 414
	}
415

  
416 415
	return($gateways_arr);
417 416
}
418 417

  
......
623 622
	}
624 623

  
625 624
	// for dynamic interfaces we handle them through the $interface_router file.
626
	if (!is_ipaddr($gw) && !is_ipaddr($gwcfg['ipaddr'])) {
625
	if (!is_ipaddrv4($gw) && !is_ipaddrv4($gwcfg['ipaddr'])) {
627 626
		$realif = get_real_interface($interface);
628 627
		if (file_exists("{$g['tmp_path']}/{$realif}_router")) {
629 628
				$gw = trim(file_get_contents("{$g['tmp_path']}/{$realif}_router"), " \n");
......
653 652
	}
654 653

  
655 654
	// for dynamic interfaces we handle them through the $interface_router file.
656
	if (!is_ipaddrv6($gw) && !is_ipaddr($gwcfg['ipaddrv6'])) {
655
	if (!is_ipaddrv6($gw) && !is_ipaddrv6($gwcfg['ipaddrv6'])) {
657 656
			$realif = get_real_interface($interface);
658 657
			if (file_exists("{$g['tmp_path']}/{$realif}_routerv6")) {
659 658
				$gw = trim(file_get_contents("{$g['tmp_path']}/{$realif}_routerv6"), " \n");

Also available in: Unified diff