diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-11-19 05:06:05 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-11-19 05:06:05 +0000 |
commit | 13277cbf52fc372963305f91f94fb8415be0bc43 (patch) | |
tree | 55df9b09e19806895461dde665c0a7475c2a96f2 /etc/inc | |
parent | 676c00175504d3091321197c9ce641b4b75fbb6b (diff) | |
download | pfsense-13277cbf52fc372963305f91f94fb8415be0bc43.zip pfsense-13277cbf52fc372963305f91f94fb8415be0bc43.tar.gz |
Check gateway using is_ipaddr() and log when we insert the default gateway
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/system.inc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index ab450fa..182415d 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -274,10 +274,12 @@ function system_routing_configure() { /* Make sure default gateway is present */ $result = `/usr/bin/netstat -rn | grep default`; - if(!$result) - if($config['interfaces']['wan']['gateway']) + if(!$result) { + if(is_ipaddr($config['interfaces']['wan']['gateway'])) { + log_error("No default gateway detected, adding {$config['interfaces']['wan']['gateway']}"); mwexec("/sbin/route add default " . escapeshellarg($config['interfaces']['wan']['gateway'])); - + } + } return 0; } |