summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2015-02-09 18:10:51 -0600
committerChris Buechler <cmb@pfsense.org>2015-02-09 18:10:51 -0600
commitf7dddc868b3dcd1d017b40f85da5f81f4ede1905 (patch)
tree92de004855e2d3b131074dac30f6469fa988334b /etc
parent758b51a0213a08ab4d2189f9f1513cf34608da1b (diff)
downloadpfsense-f7dddc868b3dcd1d017b40f85da5f81f4ede1905.zip
pfsense-f7dddc868b3dcd1d017b40f85da5f81f4ede1905.tar.gz
also add v6 IPs to hosts in the same manner v4 IPs are added. Ticket #4395
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/system.inc13
1 files changed, 12 insertions, 1 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 7b58cfc..0848590 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -307,15 +307,26 @@ function system_hosts_generate() {
$cfgip = get_interface_ip("lan");
if (is_ipaddr($cfgip))
$hosts .= "{$cfgip} {$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']}\n";
+ $cfgipv6 = get_interface_ipv6("lan");
+ if (is_ipaddrv6($cfgipv6))
+ $hosts .= "{$cfgipv6} {$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']}\n";
} else {
$sysiflist = get_configured_interface_list();
+ $hosts_if_found = false;
foreach ($sysiflist as $sysif) {
if (!interface_has_gateway($sysif)) {
$cfgip = get_interface_ip($sysif);
if (is_ipaddr($cfgip)) {
$hosts .= "{$cfgip} {$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']}\n";
- break;
+ $hosts_if_found = true;
+ }
+ $cfgipv6 = get_interface_ipv6($sysif);
+ if (is_ipaddrv6($cfgipv6)) {
+ $hosts .= "{$cfgipv6} {$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']}\n";
+ $hosts_if_found = true;
}
+ if ($hosts_if_found == true)
+ break;
}
}
}
OpenPOWER on IntegriCloud