diff options
author | gnhb <gnoahb@gmail.com> | 2011-01-25 11:16:05 +0700 |
---|---|---|
committer | gnhb <gnoahb@gmail.com> | 2011-01-25 11:16:05 +0700 |
commit | d5dfcb52bc72bdd1685da5e36fc1910ab16f7f5f (patch) | |
tree | 247f7d94f0492884fb87d05e7dcceb2b98d45dcb /etc/inc/interfaces.inc | |
parent | 67bc955d7946cbb38faabb2205fdf03055868289 (diff) | |
download | pfsense-d5dfcb52bc72bdd1685da5e36fc1910ab16f7f5f.zip pfsense-d5dfcb52bc72bdd1685da5e36fc1910ab16f7f5f.tar.gz |
Change name of function "interface_translate_type_to_real" to match what it's doing (or should be doing.)
Next commits will change functionality of this function because before now
it's identical to "get_real_interface" function (because of bug mentioned below.)
Also, replace interface_translate_type_to_real with get_real_interface in two places
for wireless functionality. I don't think they expect the result produced by interface_translate_type_to_real.
Change from "type" it "ipaddr" in switch statement. "type" isn't a valid field in $config['interfaces']
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 59f74c2..1e75ab4 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2468,7 +2468,7 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven $wancfg = $config['interfaces'][$interface]; $realif = get_real_interface($interface); - $realhwif = interface_translate_type_to_real($interface); + $realhwif = get_parent_interface($interface); if (!$g['booting']) { /* remove all IPv4 addresses */ @@ -2831,7 +2831,7 @@ function convert_real_interface_to_friendly_interface_name($interface = "wan") { if (stristr($interface, "_wlan0") && $config['interfaces'][$if]['if'] == interface_get_wireless_base($interface)) return $if; - $int = interface_translate_type_to_real($if); + $int = get_parent_interface($if); if ($int == $interface) return $ifname; } @@ -2903,16 +2903,18 @@ function convert_real_interface_to_friendly_descr($interface) { } /* - * interface_translate_type_to_real($interface): - * returns the real hardware interface name for a friendly interface. ie: wan + * get_parent_interface($interface): + * returns the real parent interface for a given interface description (i.e. wan) + * or a virtual interface (i.e. vlan1 or pppoe0 etc.) */ -function interface_translate_type_to_real($interface) { - global $config; +function get_parent_interface($interface) { + global $config; if (empty($config['interfaces'][$interface])) return $interface; + $tmpif = $config['interfaces'][$interface]; - switch ($tmpif['type']) { + switch ($tmpif['ipaddr']) { case "ppp": case "pppoe": case "pptp": @@ -3478,7 +3480,7 @@ function get_wireless_modes($interface) { /* return wireless modes and channels */ $wireless_modes = array(); - $wlif = interface_translate_type_to_real($interface); + $wlif = get_real_interface($interface); if(is_interface_wireless($wlif)) { $cloned_interface = get_real_interface($interface); @@ -3524,7 +3526,7 @@ function get_wireless_modes($interface) { function get_wireless_channel_info($interface) { $wireless_channels = array(); - $wlif = interface_translate_type_to_real($interface); + $wlif = get_real_interface($interface); if(is_interface_wireless($wlif)) { $cloned_interface = get_real_interface($interface); |