Project

General

Profile

« Previous | Next » 

Revision fb64f3aa

Added by Chris Buechler over 10 years ago

also add v6 IPs to hosts in the same manner v4 IPs are added. Ticket #4395

View differences:

etc/inc/system.inc
307 307
		$cfgip = get_interface_ip("lan");
308 308
		if (is_ipaddr($cfgip))
309 309
			$hosts .= "{$cfgip}	{$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']}\n";
310
		$cfgipv6 = get_interface_ipv6("lan");
311
		if (is_ipaddrv6($cfgipv6))
312
			$hosts .= "{$cfgipv6}	{$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']}\n";
310 313
	} else {
311 314
		$sysiflist = get_configured_interface_list();
315
		$hosts_if_found = false;
312 316
		foreach ($sysiflist as $sysif) {
313 317
			if (!interface_has_gateway($sysif)) {
314 318
				$cfgip = get_interface_ip($sysif);
315 319
				if (is_ipaddr($cfgip)) {
316 320
					$hosts .= "{$cfgip}	{$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']}\n";
317
					break;
321
					$hosts_if_found = true;
322
				}
323
				$cfgipv6 = get_interface_ipv6($sysif);
324
				if (is_ipaddrv6($cfgipv6)) {
325
					$hosts .= "{$cfgipv6}	{$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']}\n";
326
					$hosts_if_found = true;
318 327
				}
328
				if ($hosts_if_found == true)
329
					break;
319 330
			}
320 331
		}
321 332
	}

Also available in: Unified diff