summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2010-02-06 12:22:19 +0000
committerErmal Luçi <eri@pfsense.org>2010-02-06 12:22:19 +0000
commit629208a2315b502c42031d3adce5b19284f3ac25 (patch)
tree015a86ef3e46264c8409035a0ef820139e7298fc
parent2a63c863f5545dd967eef61c88294ea188bd04fa (diff)
downloadpfsense-629208a2315b502c42031d3adce5b19284f3ac25.zip
pfsense-629208a2315b502c42031d3adce5b19284f3ac25.tar.gz
Ticket #335. If guess_interface_from_ip in interface.inc is used on an IP address that goes through a bridge interface, the returned interface name will just be bridge without a number. I found that netstat -rn does not show the number (not sure why), but netstat -rnW does.
-rw-r--r--etc/inc/interfaces.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 7de3e55..1993955 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -2442,12 +2442,12 @@ function guess_interface_from_ip($ipaddress) {
return false;
}
/* create a route table we can search */
- exec("netstat -rn", $output, $ret);
+ exec("netstat -rnW", $output, $ret);
foreach($output as $line) {
if(preg_match("/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\/[0-9]+[ ]+link[#]/", $line)) {
$fields = preg_split("/[ ]+/", $line);
if(ip_in_subnet($ipaddress, $fields[0])) {
- return $fields[5];
+ return $fields[6];
}
}
}
OpenPOWER on IntegriCloud