Project

General

Profile

« Previous | Next » 

Revision d5e4f7c9

Added by Jim Pingle almost 12 years ago

Use the name of the interface (lan, opt1, etc) rather than a loop-derived number for the DHCP failover peer name. This should be more accurate in cases where DHCP changes for interfaces happen out of order on CARP clusters, or when somehow an interface's configuration exists on one but not the other.

View differences:

etc/inc/services.inc
433 433
	/*    loop through and determine if we need to setup
434 434
	 *    failover peer "bleh" entries
435 435
	 */
436
	$dhcpnum = 0;
437 436
	foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) {
438 437

  
439 438
		interfaces_staticarp_configure($dhcpif);
......
475 474
				$dhcpdconf_pri .= "  mclt 600;\n";
476 475
			}
477 476
			$dhcpdconf .= <<<EOPP
478
failover peer "dhcp{$dhcpnum}" {
477
failover peer "dhcp_{$dhcpif}" {
479 478
  {$type};
480 479
  address {$intip};
481 480
  port {$my_port};
......
488 487
}
489 488

  
490 489
EOPP;
491
		$dhcpnum++;
492 490
		}
493 491
	}
494 492

  
495
	$dhcpnum = 0;
496

  
497 493
	foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) {
498 494

  
499 495
		$newzone = array();
......
620 616
				$dhcpdconf .= "		option routers {$poolconf['gateway']};\n";
621 617

  
622 618
			if($dhcpifconf['failover_peerip'] <> "") {
623
				$dhcpdconf .= "		failover peer \"dhcp{$dhcpnum}\";\n";
624
				$dhcpnum++;
619
				$dhcpdconf .= "		failover peer \"dhcp_{$dhcpif}\";\n";
625 620
			}
626 621

  
627 622
			$pdnscfg = "";

Also available in: Unified diff