Project

General

Profile

System.DNSForwarderDHCPDomainName.FIX.patch

patch -p0 -i System.DNSForwarderDHCPDomainName.FIX.patch - NOYB NOYB, 08/29/2011 10:27 PM

View differences:

/etc/inc/system.inc.patched 2011-08-29 18:29:46.000000000 -0700
252 252
		foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf)
253 253
			if(is_array($dhcpifconf['staticmap']) && isset($dhcpifconf['enable']))
254 254
					foreach ($dhcpifconf['staticmap'] as $host)
255
						if ($host['ipaddr'] && $host['hostname'])
256
							$dhosts .= "{$host['ipaddr']}	{$host['hostname']}.{$syscfg['domain']} {$host['hostname']}\n";
255
						if ($host['ipaddr'] && $host['hostname']) {
256
							if ($config['dhcpd'][$dhcpif]['domain']) $dyndhcpifdomainname = $config['dhcpd'][$dhcpif]['domain'];	// Use Services DHCP Interface Domain Name
257
							else $dyndhcpifdomainname = $syscfg['domain'];									// Use System General Domain Name
258
							$dhosts .= "{$host['ipaddr']}	{$host['hostname']}.{$dyndhcpifdomainname} {$host['hostname']}\n";
259
						}
257 260
	}
258 261

  
259 262
	if (isset($dnsmasqcfg['dhcpfirst']))
......
291 294
		@touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases");
292 295
		if (file_exists("{$g['varrun_path']}/dhcpleases.pid"))
293 296
				sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "HUP");
294
		else
295
			mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$config['system']['domain']} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts");
297
		else {
298
			if ($config['dhcpd']['lan']['domain']) $dyndhcpifdomainname = $config['dhcpd']['lan']['domain'];	// Use Services DHCP 'LAN' Interface Domain Name
299
			else $dyndhcpifdomainname = $config['system']['domain'];						// Use System General Domain Name
300
			mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$dyndhcpifdomainname} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts");
301
		}
296 302
	} else {
297 303
		sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "TERM");
298 304
		@unlink("{$g['varrun_path']}/dhcpleases.pid");