diff options
author | gnhb <gnoahb@gmail.com> | 2010-05-12 19:27:12 +0700 |
---|---|---|
committer | gnhb <gnoahb@gmail.com> | 2010-05-12 19:27:12 +0700 |
commit | 37df6d7b15905be3dd198d9c17f19a1697beea9f (patch) | |
tree | ef071adda82633630b88de0041b20f757c82bb89 /etc/inc/system.inc | |
parent | 04d36b1f1fdff85cd902b9aa15103b98475b4777 (diff) | |
parent | e256e9d4d1dedb1418204d2879c7dcf7edcf2137 (diff) | |
download | pfsense-37df6d7b15905be3dd198d9c17f19a1697beea9f.zip pfsense-37df6d7b15905be3dd198d9c17f19a1697beea9f.tar.gz |
Merge branch 'master' of http://gitweb.pfsense.org/pfsense/mainline into mlppp
Conflicts:
etc/inc/upgrade_config.inc
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r-- | etc/inc/system.inc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index d26b1bb..369d181 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -192,11 +192,21 @@ function system_hosts_generate() { $hosts .= "127.0.0.1 localhost localhost.{$syscfg['domain']}\n"; - $sysiflist = get_configured_interface_list(); - foreach ($sysiflist as $sysif) { - $cfgip = get_interface_ip($sysif); + if ($config['interfaces']['lan']) { + $cfgip = get_interface_ip("lan"); if (is_ipaddr($cfgip)) $hosts .= "{$cfgip} {$syscfg['hostname']}.{$syscfg['domain']} {$syscfg['hostname']}\n"; + } else { + $sysiflist = get_configured_interface_list(); + 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; + } + } + } } foreach ($hostscfg as $host) { @@ -281,7 +291,7 @@ function system_routing_configure() { * gateway setup configured. * Force WAN to be default gateway because that is the 1.2 behavior. */ - log_error("SYSTEM: We do not have a default gateway in our config. Is this configuration damaged?"); + log_error("WARNING: There is no default gateway in the configuration."); if (is_ipaddr($config['interfaces']['wan']['gateway'])) { $gatewayip = $config['interfaces']['wan']['gateway']; mwexec("/sbin/route add default " . escapeshellarg($gatewayip), true); @@ -303,7 +313,7 @@ function system_routing_configure() { } else if (is_ipaddr($rtent['gateway'])) { $gatewayip = $rtent['gateway']; } else { - log_error("Static Routes: Gateway ip could not be found for {$rtent['network']}"); + log_error("Static Routes: Gateway IP could not be found for {$rtent['network']}"); continue; } |