summaryrefslogtreecommitdiffstats
path: root/etc/inc/services.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-09-10 09:10:06 +0000
committerErmal <eri@pfsense.org>2013-09-10 09:10:06 +0000
commit24670866827b4e2d7a4a05baaf6d09ee377ce7cb (patch)
treeb4519c9ca671ac00b2d1dc9e3ec0435446400f6d /etc/inc/services.inc
parent168a19487050d7af3ad6b0d7bd9c858c5810cde5 (diff)
downloadpfsense-24670866827b4e2d7a4a05baaf6d09ee377ce7cb.zip
pfsense-24670866827b4e2d7a4a05baaf6d09ee377ce7cb.tar.gz
Correctly check the secondary/primary parameter setting on dhcp failover configuration
Diffstat (limited to 'etc/inc/services.inc')
-rw-r--r--etc/inc/services.inc20
1 files changed, 13 insertions, 7 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index a6db67c..96019f4 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -440,9 +440,7 @@ EOD;
continue;
if($dhcpifconf['failover_peerip'] <> "") {
- $int = guess_interface_from_ip($dhcpifconf['failover_peerip']);
- $intip = find_interface_ip($int);
- $real_dhcpif = convert_friendly_interface_to_real_interface_name($dhcpif);
+ $intip = get_interface_ip($dhcpif);
/*
* yep, failover peer is defined.
* does it match up to a defined vip?
@@ -450,10 +448,15 @@ EOD;
$skew = 110;
if(is_array($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $vipent) {
- if($vipent['subnet'] == $intip) {
- /* this is the interface! */
- if(is_numeric($vipent['advskew']) && ($vipent['advskew'] < "20"))
- $skew = 0;
+ 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;
+ }
+ }
}
}
} else {
@@ -471,6 +474,8 @@ EOD;
$dhcpdconf_pri = "split 128;\n";
$dhcpdconf_pri .= " mclt 600;\n";
}
+
+ if (is_ipaddrv4($intip)) {
$dhcpdconf .= <<<EOPP
failover peer "dhcp_{$dhcpif}" {
{$type};
@@ -485,6 +490,7 @@ failover peer "dhcp_{$dhcpif}" {
}
EOPP;
+ }
}
}
OpenPOWER on IntegriCloud