diff options
author | Ermal Luçi <eri@pfsense.org> | 2010-02-12 17:33:52 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2010-02-12 17:33:52 +0000 |
commit | 8eaa727f5df9461093e025f9688ac3906434d76a (patch) | |
tree | 2355ff12113fe219104e4507d43e1669dc4f2361 /etc | |
parent | 9a76a52a7be6320a87e3a0868d68b9e86710b417 (diff) | |
download | pfsense-8eaa727f5df9461093e025f9688ac3906434d76a.zip pfsense-8eaa727f5df9461093e025f9688ac3906434d76a.tar.gz |
Revert find_interface_subnet() because it need to return numbers and not netmask in dotted format.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/interfaces.inc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 773c22f..f6fc5fc 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2660,8 +2660,11 @@ function find_interface_subnet($interface, $flush = false) return; if (!isset($interface_sn_arr_cache[$interface]) or $flush) { - $ifinfo = pfSense_get_interface_addresses($interface); - $interface_sn_arr_cache[$interface] = $ifinfo['subnet']; + 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))); } return $interface_sn_arr_cache[$interface]; |