Project

General

Profile

« Previous | Next » 

Revision a3d6166b

Added by Jim Pingle almost 12 years ago

Fix didn't help -- backing this out and the change that made it necessary. Revert "Correctly check the secondary/primary parameter setting on dhcp failover configuration"

This reverts commit 24670866827b4e2d7a4a05baaf6d09ee377ce7cb.

View differences:

etc/inc/services.inc
440 440
			continue;
441 441

  
442 442
		if($dhcpifconf['failover_peerip'] <> "") {
443
			$intip = get_interface_ip($dhcpif);
443
			$int = guess_interface_from_ip($dhcpifconf['failover_peerip']);
444
			$intip = find_interface_ip($int);
445
			$real_dhcpif = convert_friendly_interface_to_real_interface_name($dhcpif);
444 446
			/*
445 447
			 *    yep, failover peer is defined.
446 448
			 *    does it match up to a defined vip?
......
448 450
			$skew = 110;
449 451
			if(is_array($config['virtualip']['vip'])) {
450 452
				foreach ($config['virtualip']['vip'] as $vipent) {
451
					if($vipent['interface'] == $dhcpif) {
452
						$carp_nw = gen_subnet($vipent['subnet'], $vipent['subnet_bits']);
453
						if (ip_in_subnet($dhcpifconf['failover_peerip'], "{$carp_nw}/{$vipent['subnet_bits']}")) {
454
							/* this is the interface! */
455
							if(is_numeric($vipent['advskew']) && (intval($vipent['advskew']) < 20)) {
456
								$skew = 0;
457
								break;
458
							}
459
						}
453
					if($vipent['subnet'] == $intip) {
454
						/* this is the interface! */
455
						if(is_numeric($vipent['advskew']) && ($vipent['advskew'] < "20"))
456
							$skew = 0;
460 457
					}
461 458
				}
462 459
			} else {
......
474 471
				$dhcpdconf_pri  = "split 128;\n";
475 472
				$dhcpdconf_pri .= "  mclt 600;\n";
476 473
			}
477

  
478
			if (is_ipaddrv4($intip)) {
479 474
			$dhcpdconf .= <<<EOPP
480 475
failover peer "dhcp_{$dhcpif}" {
481 476
  {$type};
......
490 485
}
491 486

  
492 487
EOPP;
493
			}
494 488
		}
495 489
	}
496 490

  

Also available in: Unified diff