From 6a01ea44fbb8ed7144eed374a77681f32cf17cac Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Sat, 11 Nov 2006 17:52:40 +0000 Subject: MFC [15285] add dhcpd static mappings to dns forwarder --- etc/inc/services.inc | 10 +++++++--- etc/inc/system.inc | 7 +++++++ 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'etc') diff --git a/etc/inc/services.inc b/etc/inc/services.inc index cea79fe..b3ef24e 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -560,6 +560,8 @@ EOD; function services_dnsmasq_configure() { global $config, $g; + $return = 0; + if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "services_dnsmasq_configure() being called $mt\n"; @@ -576,7 +578,8 @@ function services_dnsmasq_configure() { sleep(1); /* generate hosts file */ - system_hosts_generate(); + if(system_hosts_generate()!=0) + $return = 1; $args = ""; @@ -600,10 +603,11 @@ function services_dnsmasq_configure() { } if (!$g['booting']) { - services_dhcpd_configure(); + if(services_dhcpd_configure()!=0) + $return = 1; } - return 0; + return $return; } function services_snmpd_configure() { diff --git a/etc/inc/system.inc b/etc/inc/system.inc index bd5c2fa..eadb100 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -185,6 +185,13 @@ EOD; else $hosts .= "{$host['ip']} {$host['domain']}\n"; } + if (isset($dnsmasqcfg['regdhcpstatic'])) { + foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) + if(is_array($dhcpifconf['staticmap']) && isset($dhcpifconf['enable'])) + foreach ($dhcpifconf['staticmap'] as $host) + if ($host['ipaddr'] && $host['hostname']) + $hosts .= "{$host['ipaddr']} {$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n"; + } fwrite($fd, $hosts); fclose($fd); -- cgit v1.1