summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2010-02-02 22:40:14 +0000
committerErmal Luçi <eri@pfsense.org>2010-02-02 22:40:14 +0000
commit58085ef4e5f07c4f86f891fa9b0c58fc655a8225 (patch)
treef84d43b6681bf1613305dbf47c129a9048e6e856
parent8604523be39caa46b8cfd05702f6aff63958a48a (diff)
downloadpfsense-58085ef4e5f07c4f86f891fa9b0c58fc655a8225.zip
pfsense-58085ef4e5f07c4f86f891fa9b0c58fc655a8225.tar.gz
Get the correct value as subnet for 'virtual' interfaces. This unbreaks the Routing pages validation on this types of interfaces.
-rw-r--r--etc/inc/interfaces.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 8fdb4bd..b3b890e 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -2645,7 +2645,10 @@ function find_interface_subnet($interface, $flush = false)
return;
if (!isset($interface_sn_arr_cache[$interface]) or $flush) {
- $interface_sn_arr_cache[$interface] = `/sbin/ifconfig {$interface} | /usr/bin/grep -w "inet" | /usr/bin/cut -d" " -f 4 | /usr/bin/head -1`;
+ if (preg_match("/^tun|^ppp|^pptp|^pppoe|^ovpn|^gif|^gre|^lagg|^bridge|*vlan/i", $interface))
+ $interface_sn_arr_cache[$interface] = `/sbin/ifconfig {$interface} | /usr/bin/grep -w "inet" | /usr/bin/cut -d" " -f 6 | /usr/bin/head -1`;
+ else
+ $interface_sn_arr_cache[$interface] = `/sbin/ifconfig {$interface} | /usr/bin/grep -w "inet" | /usr/bin/cut -d" " -f 4 | /usr/bin/head -1`;
$interface_sn_arr_cache[$interface] = strlen(str_replace("0", "", base_convert(str_replace("\n", "", $interface_sn_arr_cache[$interface]),16, 2)));
}
OpenPOWER on IntegriCloud