mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Get the correct value as subnet for 'virtual' interfaces. This unbreaks the Routing pages validation on this types of interfaces.
This commit is contained in:
parent
8604523be3
commit
58085ef4e5
@ -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)));
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user