diff options
author | Ermal Luçi <eri@pfsense.org> | 2010-02-06 12:22:19 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2010-02-06 12:22:19 +0000 |
commit | 629208a2315b502c42031d3adce5b19284f3ac25 (patch) | |
tree | 015a86ef3e46264c8409035a0ef820139e7298fc | |
parent | 2a63c863f5545dd967eef61c88294ea188bd04fa (diff) | |
download | pfsense-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.inc | 4 |
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]; } } } |