interfaces: return $ifname and decouple the search loop

This looks like a typo in the original code as we expect to return
a "wan|lan|optx" thingy.

"Parent" lookup isn't really very useful except for PPP types.
The question is if there is an edge case that would still allow
this to resolve when the other code preceeding it can not.
This commit is contained in:
Franco Fichtner 2021-12-06 14:05:22 +01:00
parent 351295ecba
commit 024c7e1694

View File

@ -3536,10 +3536,13 @@ function convert_real_interface_to_friendly_interface_name($interface = 'wan')
if (get_real_interface($ifname) == $interface) {
return $ifname;
}
}
// search unnecessary?
foreach (array_keys($all_interfaces) as $ifname) {
list ($ifparent) = get_parent_interface($ifname);
if ($ifparent == $interface) {
return $ifparent;
return $ifname;
}
}
@ -3658,7 +3661,6 @@ function get_parent_interface($interface)
return $parents;
}
function interface_get_wireless_base($wlif)
{
if (!strstr($wlif, '_wlan')) {