summaryrefslogtreecommitdiffstats
path: root/etc/inc/pfsense-utils.inc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2009-01-13 22:08:41 +0000
committerSeth Mos <seth.mos@xs4all.nl>2009-01-13 22:08:41 +0000
commitc806f1bbc83c25966808598a75c0e2ae03707dd5 (patch)
tree2043d109c688a5b36e55d9459bcb2c20e875119f /etc/inc/pfsense-utils.inc
parentfc373d0ecbf8557e57d9c942d50bb99ddbda9380 (diff)
downloadpfsense-c806f1bbc83c25966808598a75c0e2ae03707dd5.zip
pfsense-c806f1bbc83c25966808598a75c0e2ae03707dd5.tar.gz
Replace another route -n get command. These can sometimes hang and cause a filter reload to get stuck.
Always use netstat -rn instead, these behave differently and can not hang according to ermal@
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r--etc/inc/pfsense-utils.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index a089743..56ab757 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1434,7 +1434,10 @@ function find_interface_ip($interface, $flush = false) {
}
function guess_interface_from_ip($ipaddress) {
- $ret = exec_command("/sbin/route -n get {$ipaddress} | /usr/bin/grep interface | /usr/bin/awk '{ print \$2; };'");
+ $ret = exec_command("/usr/bin/netstat -rn | /usr/bin/awk '/^{$ipaddress}/ {print \$6}'");
+ if(empty($ret)) {
+ return false;
+ }
return $ret;
}
@@ -3737,4 +3740,4 @@ function safe_write_file($file, $content, $force_binary) {
return true;
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud