Commit 09f9ace8 authored by Franco Fichtner's avatar Franco Fichtner

interfaces: zap wrapper around get_real_interface()

parent ddc987e2
......@@ -3985,16 +3985,12 @@ function is_interface_group($if)
return false;
}
function interface_group_add_member($interface, $groupname) {
function interface_group_add_member($interface, $groupname)
{
$interface = get_real_interface($interface);
mwexec("/sbin/ifconfig {$interface} group " . escapeshellarg($groupname), true);
}
/* COMPAT Function */
function convert_friendly_interface_to_real_interface_name($interface) {
return get_real_interface($interface);
}
/* convert fxp0 -> wan, etc. */
function convert_real_interface_to_friendly_interface_name($interface = 'wan')
{
......
......@@ -36,13 +36,13 @@ function sync_package_miniupnpd() {
$upnp_config = $config['installedpackages']['miniupnpd']['config'][0];
$config_file = '/var/etc/miniupnpd.conf';
if (!isset($upnp_config['ext_iface']) || empty($upnp_config['ext_iface']))
if (!isset($upnp_config['ext_iface']) || empty($upnp_config['ext_iface'])) {
$ext_ifname = get_real_interface();
else {
$if = convert_friendly_interface_to_real_interface_name($upnp_config['ext_iface']);
if ($if != $upnp_config['ext_iface'])
} else {
$if = get_real_interface($upnp_config['ext_iface']);
if ($if != $upnp_config['ext_iface']) {
$ext_ifname = $if;
else {
} else {
$ext_ifname = get_real_interface();
upnp_warn("Could not resolve real interface for {$upnp_config['ext_iface']}, defaulting to WAN");
}
......@@ -59,9 +59,10 @@ function sync_package_miniupnpd() {
foreach($iface_array as $iface) {
/* Setting the same internal and external interface is not allowed. */
if ($iface == $upnp_config['ext_iface'])
if ($iface == $upnp_config['ext_iface']) {
continue;
$if = convert_friendly_interface_to_real_interface_name($iface);
}
$if = get_real_interface($iface);
/* above function returns iface if fail */
if($if!=$iface) {
$addr = find_interface_ip($if);
......
......@@ -210,9 +210,10 @@ $i = 0;
$ifdescrs = get_configured_interface_with_descr();
foreach ($ifdescrs as $key => $interface) {
$thisif = convert_friendly_interface_to_real_interface_name($key);
if (!empty($thisif))
$thisif = get_real_interface($key);
if (!empty($thisif)) {
$hwif[$thisif] = $interface;
}
}
$data = array();
......
......@@ -421,7 +421,7 @@ if ($do_tcpdump) {
$searchcount = "";
}
$selectedif = convert_friendly_interface_to_real_interface_name($selectedif);
$selectedif = get_real_interface($selectedif);
if ($action == gettext("Start")) {
$matchstr = implode($matches, " and ");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment