summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-03-29 20:15:02 +0700
committergnhb <gnoahb@gmail.com>2010-03-29 20:15:02 +0700
commit68465fab8c4aeba39fcd793f208b667a1ebb4afc (patch)
tree7b3407596e30fad5cec071b022e1049fcd315da8 /etc/inc
parentc90f247117ace2af4e072e7004e1750875e568ff (diff)
parent3da49dc3aed4571c0ae75a7a0680babe98be2ee5 (diff)
downloadpfsense-68465fab8c4aeba39fcd793f208b667a1ebb4afc.zip
pfsense-68465fab8c4aeba39fcd793f208b667a1ebb4afc.tar.gz
Merge remote branch 'mainline/master'
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/gwlb.inc4
-rw-r--r--etc/inc/services.inc5
2 files changed, 6 insertions, 3 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index e53673a..1b33cc1 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -150,14 +150,14 @@ EOD;
$i = 2;
foreach($gateways_arr as $name => $gateway) {
/* for dynamic gateways without an IP address we subtitute a local one */
- if((is_numeric($gateway['attribute'])) && ($a_gateway_item[$gateway['attribute']]['monitor'] <> "")) {
+ if((is_numeric($gateway['attribute'])) && is_ipaddr($a_gateway_item[$gateway['attribute']]['monitor'])) {
$gateway['monitor'] = $a_gateway_item[$gateway['attribute']]['monitor'];
} else {
if(($gateway['gateway'] == "dynamic") && ($gateway['monitor'])) {
$gateway['monitor'] = "127.0.0.{$i}";
$i++;
}
- if($gateway['monitor'] == "") {
+ if(!is_ipaddr($gateway['monitor'])) {
$gateway['monitor'] = $gateway['gateway'];
}
}
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 8bed47d..c98e746 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -43,7 +43,10 @@ function services_parse_dhcpd_hostnames() {
// Launch if option enabled
if (isset($config['dnsmasq']['regdhcp'])) {
- mwexec("/bin/ln /etc/hosts {$g['varetc_path']}/hosts");
+ /* Make sure we do not error out */
+ @touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases");
+ if (!file_exists("{$g['varetc_path']}/hosts"))
+ mwexec("/bin/ln /etc/hosts {$g['varetc_path']}/hosts");
if (file_exists("{$g['varrun_path']}/dhcpleases.pid"))
sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "HUP");
else
OpenPOWER on IntegriCloud