From a3d6166bb20a3ff4d6a7ff57290c3e59ce51ded4 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 10 Sep 2013 11:07:38 -0400 Subject: [PATCH] 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. --- etc/inc/services.inc | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 96019f4e40..a6db67c57e 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -440,7 +440,9 @@ EOD; continue; if($dhcpifconf['failover_peerip'] <> "") { - $intip = get_interface_ip($dhcpif); + $int = guess_interface_from_ip($dhcpifconf['failover_peerip']); + $intip = find_interface_ip($int); + $real_dhcpif = convert_friendly_interface_to_real_interface_name($dhcpif); /* * yep, failover peer is defined. * does it match up to a defined vip? @@ -448,15 +450,10 @@ EOD; $skew = 110; if(is_array($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $vipent) { - if($vipent['interface'] == $dhcpif) { - $carp_nw = gen_subnet($vipent['subnet'], $vipent['subnet_bits']); - if (ip_in_subnet($dhcpifconf['failover_peerip'], "{$carp_nw}/{$vipent['subnet_bits']}")) { - /* this is the interface! */ - if(is_numeric($vipent['advskew']) && (intval($vipent['advskew']) < 20)) { - $skew = 0; - break; - } - } + if($vipent['subnet'] == $intip) { + /* this is the interface! */ + if(is_numeric($vipent['advskew']) && ($vipent['advskew'] < "20")) + $skew = 0; } } } else { @@ -474,8 +471,6 @@ EOD; $dhcpdconf_pri = "split 128;\n"; $dhcpdconf_pri .= " mclt 600;\n"; } - - if (is_ipaddrv4($intip)) { $dhcpdconf .= <<