summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2010-02-17 15:52:57 +0000
committerErmal Luçi <eri@pfsense.org>2010-02-17 15:52:57 +0000
commitbd96e1fef91e4545402fa5863bb6b3f898e52139 (patch)
tree6388c2c33f78868dc89301be5a11e4692062a321
parentd0f6649c8fc45e4261cbd651fbcda136205d29de (diff)
downloadpfsense-bd96e1fef91e4545402fa5863bb6b3f898e52139.zip
pfsense-bd96e1fef91e4545402fa5863bb6b3f898e52139.tar.gz
Use the pfSense module function to get mtu and subnetbits in CIDR format.
-rw-r--r--etc/inc/interfaces.inc11
1 files changed, 4 insertions, 7 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index f57b267..9941a56 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -2676,11 +2676,8 @@ function find_interface_subnet($interface, $flush = false)
return;
if (!isset($interface_sn_arr_cache[$interface]) or $flush) {
- if (preg_match("/^tun|^ppp|^pptp|^pppoe|^ovpn|^gif|^gre/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)));
+ $ifinfo = pfSense_get_interface_addresses($interface);
+ $interface_sn_arr_cache[$interface] = $ifinfo['subnetbits'];
}
return $interface_sn_arr_cache[$interface];
@@ -2883,8 +2880,8 @@ function get_wireless_modes($interface) {
* $tmp - Returns the mtu of an interface
******/
function get_interface_mtu($interface) {
- $mtu = `/sbin/ifconfig {$interface} | /usr/bin/grep mtu | /usr/bin/cut -d" " -f6`;
- return $mtu;
+ $mtu = pfSense_get_interface_addresses($interface);
+ return $mtu['mtu'];
}
function get_interface_mac($interface) {
OpenPOWER on IntegriCloud