aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-02-24 21:37:23 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-02-24 21:37:23 +0000
commit427780e7a7da691c21ef1d6de15e0cb2f225e543 (patch)
treec54e2f42375ecf95d5d332214791b0e33db276b5
parent2dc9187680d41cfa8727f95869ac1dbd9e1f074a (diff)
downloadpfsense-packages-427780e7a7da691c21ef1d6de15e0cb2f225e543.tar.gz
pfsense-packages-427780e7a7da691c21ef1d6de15e0cb2f225e543.tar.bz2
pfsense-packages-427780e7a7da691c21ef1d6de15e0cb2f225e543.zip
Register static leases from other LAN like interfaces (OPTX with no GW).
Submitted-by: luisousa via forum http://forum.pfsense.org/index.php/topic,8004.0.html
-rw-r--r--packages/tinydns/tinydns.inc36
1 files changed, 24 insertions, 12 deletions
diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc
index 9f5e0ca4..b3abb5e1 100644
--- a/packages/tinydns/tinydns.inc
+++ b/packages/tinydns/tinydns.inc
@@ -338,18 +338,30 @@ function tinydns_create_zone_file() {
}
/* Register Static IPs */
- if($config['installedpackages']['tinydns']['config'][0]['regdhcpstatic']) {
- if(is_array($config['dhcpd']['lan']['staticmap'])) {
- foreach($config['dhcpd']['lan']['staticmap'] as $dhcpdstatic) {
- $dhcpdhostname = $dhcpdstatic['hostname'];
- $dhcpdfqdn = "{$dhcpdhostname}.{$dhcpddomain}";
- $dhcpdlanip = $dhcpdstatic['ipaddr'];
- $dhcpda = "={$dhcpdfqdn}:{$dhcpdlanip}";
- if($dhcpdhostname)
- fwrite($fd, $dhcpda . "\n");
- }
- }
- }
+ if($config['installedpackages']['tinydns']['config'][0]['regdhcpstatic']) {
+ foreach($config['dhcpd'] as $zone_key => $zone ) {
+ $dhcpdhostname = $config['system']['hostname'];
+ if ($zone['ddnsdomain'])
+ $dhcpddomain = $zone['ddnsdomain'];
+ else
+ $dhcpddomain = $config['system']['domain'];
+ $dhcpdlanip = $config['interfaces'][$zone_key]['ipaddr'];
+ $dhcpdipmask = $config['interfaces'][$zone_key]['subnet'];
+ $dhcpdfqdn = "{$dhcpdhostname}.{$dhcpddomain}";
+ tinydns_complete_soa_record($fd, $dhcpdlanip, $dhcpdipmask, $dhcpdhostname, $dhcpddomain);
+
+ if(is_array($zone['staticmap'])) {
+ foreach($zone['staticmap'] as $dhcpdstatic) {
+ $dhcpdhostname = $dhcpdstatic['hostname'];
+ $dhcpdfqdn = "{$dhcpdhostname}.{$dhcpddomain}";
+ $dhcpdlanip = $dhcpdstatic['ipaddr'];
+ $dhcpda = "={$dhcpdfqdn}:{$dhcpdlanip}";
+ if($dhcpdhostname)
+ fwrite($fd, $dhcpda . "\n");
+ }
+ }
+ }
+ }
/* Register Dynamic IPs */
if($config['installedpackages']['tinydns']['config'][0]['regdhcp']) {