diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-05-01 13:09:04 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-05-01 13:09:04 -0300 |
commit | ea1aca1326c79d5c819ec7c22c068b1c63074828 (patch) | |
tree | 3ea3afab2142ad6a1a474d00f9cd122272b6631c /usr/local/www | |
parent | dfe2769c46d6f1a5fb29218e902901ea3ea080cb (diff) | |
download | pfsense-ea1aca1326c79d5c819ec7c22c068b1c63074828.zip pfsense-ea1aca1326c79d5c819ec7c22c068b1c63074828.tar.gz |
Fix dnsmasq host overrides and dhcp integration
. Do not execute following actions when dnsmasq is disabled:
. Add host overrides to /etc/hosts
. Register DHCP leases in DNS Forwarder
. Register DHCP static mappings in DNS forwarder
It should fix issue reported at following forum post:
http://forum.pfsense.org/index.php?topic=58871
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/bandwidth_by_ip.php | 2 | ||||
-rwxr-xr-x | usr/local/www/services_dhcp.php | 4 | ||||
-rwxr-xr-x | usr/local/www/services_dhcp_edit.php | 2 | ||||
-rw-r--r-- | usr/local/www/services_dhcpv6.php | 4 | ||||
-rw-r--r-- | usr/local/www/services_dhcpv6_edit.php | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/usr/local/www/bandwidth_by_ip.php b/usr/local/www/bandwidth_by_ip.php index 8f91489..0140a74 100755 --- a/usr/local/www/bandwidth_by_ip.php +++ b/usr/local/www/bandwidth_by_ip.php @@ -42,7 +42,7 @@ $hostipformat = $_GET['hostipformat']; $iplookup = array(); // If hostname display is requested and the DNS forwarder does not already have DHCP static names registered, // then load the DHCP static mappings into an array keyed by IP address. -if (($hostipformat != "") && (!isset($config['dnsmasq']['regdhcpstatic']))) { +if (($hostipformat != "") && (!isset($config['dnsmasq']['enable']) || !isset($config['dnsmasq']['regdhcpstatic']))) { if (is_array($config['dhcpd'])) { foreach ($config['dhcpd'] as $ifdata) { if (is_array($ifdata['staticmap'])) { diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 81c9b2b..6781ece 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -503,7 +503,7 @@ if ($_POST) { dhcp_clean_leases(); /* dnsmasq_configure calls dhcpd_configure */ /* no need to restart dhcpd twice */ - if (isset($config['dnsmasq']['regdhcpstatic'])) { + if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) { $retvaldns = services_dnsmasq_configure(); if ($retvaldns == 0) { clear_subsystem_dirty('hosts'); @@ -535,7 +535,7 @@ if ($act == "del") { write_config(); if(isset($config['dhcpd'][$if]['enable'])) { mark_subsystem_dirty('staticmaps'); - if (isset($config['dnsmasq']['regdhcpstatic'])) + if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) mark_subsystem_dirty('hosts'); } header("Location: services_dhcp.php?if={$if}"); diff --git a/usr/local/www/services_dhcp_edit.php b/usr/local/www/services_dhcp_edit.php index 3a5e945..6e81277 100755 --- a/usr/local/www/services_dhcp_edit.php +++ b/usr/local/www/services_dhcp_edit.php @@ -289,7 +289,7 @@ if ($_POST) { if(isset($config['dhcpd'][$if]['enable'])) { mark_subsystem_dirty('staticmaps'); - if (isset($config['dnsmasq']['regdhcpstatic'])) + if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) mark_subsystem_dirty('hosts'); } diff --git a/usr/local/www/services_dhcpv6.php b/usr/local/www/services_dhcpv6.php index fe5fe5f..7872721 100644 --- a/usr/local/www/services_dhcpv6.php +++ b/usr/local/www/services_dhcpv6.php @@ -328,7 +328,7 @@ if ($_POST) { // dhcp_clean_leases(); /* dnsmasq_configure calls dhcpd_configure */ /* no need to restart dhcpd twice */ - if (isset($config['dnsmasq']['regdhcpstatic'])) { + if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) { $retvaldns = services_dnsmasq_configure(); if ($retvaldns == 0) { clear_subsystem_dirty('hosts'); @@ -351,7 +351,7 @@ if ($_GET['act'] == "del") { write_config(); if(isset($config['dhcpdv6'][$if]['enable'])) { mark_subsystem_dirty('staticmapsv6'); - if (isset($config['dnsmasq']['regdhcpstaticv6'])) + if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstaticv6'])) mark_subsystem_dirty('hosts'); } header("Location: services_dhcpv6.php?if={$if}"); diff --git a/usr/local/www/services_dhcpv6_edit.php b/usr/local/www/services_dhcpv6_edit.php index ded788b..a4e48e6 100644 --- a/usr/local/www/services_dhcpv6_edit.php +++ b/usr/local/www/services_dhcpv6_edit.php @@ -166,7 +166,7 @@ if ($_POST) { if(isset($config['dhcpdv6'][$if]['enable'])) { mark_subsystem_dirty('staticmaps'); - if (isset($config['dnsmasq']['regdhcpstatic'])) + if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) mark_subsystem_dirty('hosts'); } |