Commit 88855185 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

Gui slow / not responding with 150 vlan interfaces

PR: https://github.com/opnsense/core/issues/1662

(cherry picked from commit 9bba2092)
(cherry picked from commit c14db1a3)
(cherry picked from commit 24c62ed5)
(cherry picked from commit b6e4e56e)
(cherry picked from commit 6401d20e)
(cherry picked from commit de5ff59f)
(cherry picked from commit 17a9a263)
(cherry picked from commit 3b3ebbbe)
(cherry picked from commit f15eb3b2)
(cherry picked from commit 932a086e)
(cherry picked from commit 9bb3dd61)
(cherry picked from commit 89a81f3e)
(cherry picked from commit a206e8f6)
parent c3214890
......@@ -199,17 +199,11 @@ function isAuthLocalIP($http_host)
{
global $config;
$interface_list_ips = get_configured_ip_addresses();
foreach ($interface_list_ips as $ilips) {
foreach ($interface_list_ips as $ilips => $ifname) {
if (strcasecmp($http_host, $ilips) == 0) {
return true;
}
}
$interface_list_ipv6s = get_configured_ipv6_addresses();
foreach ($interface_list_ipv6s as $ilipv6s) {
if (strcasecmp($http_host, $ilipv6s) == 0) {
return true;
}
}
if (isset($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $vip) {
if ($vip['subnet'] == $http_host) {
......
......@@ -3747,11 +3747,15 @@ function convert_real_interface_to_friendly_interface_name($interface = 'wan')
return null;
}
foreach (legacy_config_get_interfaces() as $if => $ifname) {
// search direct
foreach ($config['interfaces'] as $if => $ifname) {
if ($if == $interface || $ifname['if'] == $interface) {
return $if;
}
}
// search related
foreach ($config['interfaces'] as $if => $ifname) {
if (get_real_interface($if) == $interface) {
return $if;
}
......@@ -3947,16 +3951,12 @@ function get_real_interface($interface = "wan", $family = "all", $realv6iface =
$wanif = "enc0";
break;
default:
// If a real interface was alread passed simply
// pass the real interface back. This encourages
// the usage of this function in more cases so that
// we can combine logic for more flexibility.
if (empty($config['interfaces'][$interface])) {
// leftover from legacy code, it's not a very bright idea to use the same function call
// for both virtual as real interface names. does_interface_exist() is quite expensive.
if (does_interface_exist($interface, $flush)) {
$wanif = $interface;
break;
}
if (empty($config['interfaces'][$interface])) {
break;
}
......@@ -4621,79 +4621,44 @@ function get_failover_interface($interface, $family = "all")
}
//returns interface information
function get_interface_info($ifdescr)
function get_interfaces_info()
{
global $config;
$result = array();
$all_intf_details = legacy_interfaces_details();
$ifup = legacy_interface_listget('up');
$all_intf_stats = legacy_interface_stats();
foreach (legacy_config_get_interfaces(array("virtual" => false)) as $ifdescr => $ifcnf) {
$ifinfo = array();
if (empty($config['interfaces'][$ifdescr])) {
return;
}
$ifinfo['if'] = get_real_interface($ifdescr);
$ifinfo['status'] = (is_array($ifup) && in_array($ifinfo['if'], $ifup)) ? 'up' : 'down';
if (!empty($all_intf_details[$ifinfo['if']])) {
if (in_array($all_intf_details[$ifinfo['if']]['status'], array('active', 'running'))) {
$all_intf_details[$ifinfo['if']]['status'] = $ifinfo['status'];
}
$ifinfo = array_merge($ifinfo, $all_intf_details[$ifinfo['if']]);
}
$chkif = $ifinfo['if'];
$ifinfotmp = legacy_get_interface_addresses($chkif);
$ifinfo['macaddr'] = $ifinfotmp['macaddr'];
$ifinfo['ipaddr'] = $ifinfotmp['ipaddr'];
$ifinfo['subnet'] = $ifinfotmp['subnet'];
$ifup = legacy_interface_listget('up');
$ifinfo['status'] = (is_array($ifup) && in_array($chkif, $ifup)) ? 'up' : 'down';
$ifinfo['linklocal'] = get_interface_linklocal($ifdescr);
$ifinfo['ipaddrv6'] = get_interface_ipv6($ifdescr);
$ifinfo['subnetv6'] = get_interface_subnetv6($ifdescr);
if (!empty($ifinfo['ipv6'])) {
foreach ($ifinfo['ipv6'] as $ipv6addr) {
if (!empty($ipv6addr['link-local'])) {
$ifinfo['linklocal'] = $ipv6addr['ipaddr'];
} elseif (empty($ifinfo['ipaddrv6'])) {
$ifinfo['ipaddrv6'] = $ipv6addr['ipaddr'];
$ifinfo['subnetv6'] = $ipv6addr['subnetbits'];
}
}
}
if (!empty($ifinfo['ipv4'])) {
$ifinfo['ipaddr'] = $ifinfo['ipv4'][0]['ipaddr'];
$ifinfo['subnet'] = $ifinfo['ipv4'][0]['subnetbits'];
}
$ifinfotmp = legacy_interface_stats($chkif);
$ifinfotmp = $all_intf_stats[$ifinfo['if']];
$ifinfo['inerrs'] = $ifinfotmp['input errors'];
$ifinfo['outerrs'] = $ifinfotmp['output errors'];
$ifinfo['collisions'] = $ifinfotmp['collisions'];
/* Use pfctl for non wrapping 64 bit counters */
/* Pass */
exec("/sbin/pfctl -vvsI -i {$chkif}", $pfctlstats);
$pf_in4_pass = preg_split("/ +/ ", $pfctlstats[3]);
$pf_out4_pass = preg_split("/ +/", $pfctlstats[5]);
$pf_in6_pass = preg_split("/ +/ ", $pfctlstats[7]);
$pf_out6_pass = preg_split("/ +/", $pfctlstats[9]);
$in4_pass = $pf_in4_pass[5];
$out4_pass = $pf_out4_pass[5];
$in4_pass_packets = $pf_in4_pass[3];
$out4_pass_packets = $pf_out4_pass[3];
$in6_pass = $pf_in6_pass[5];
$out6_pass = $pf_out6_pass[5];
$in6_pass_packets = $pf_in6_pass[3];
$out6_pass_packets = $pf_out6_pass[3];
$ifinfo['inbytespass'] = $in4_pass + $in6_pass;
$ifinfo['outbytespass'] = $out4_pass + $out6_pass;
$ifinfo['inpktspass'] = $in4_pass_packets + $in6_pass_packets;
$ifinfo['outpktspass'] = $out4_pass_packets + $out6_pass_packets;
/* Block */
$pf_in4_block = preg_split("/ +/", $pfctlstats[4]);
$pf_out4_block = preg_split("/ +/", $pfctlstats[6]);
$pf_in6_block = preg_split("/ +/", $pfctlstats[8]);
$pf_out6_block = preg_split("/ +/", $pfctlstats[10]);
$in4_block = $pf_in4_block[5];
$out4_block = $pf_out4_block[5];
$in4_block_packets = $pf_in4_block[3];
$out4_block_packets = $pf_out4_block[3];
$in6_block = $pf_in6_block[5];
$out6_block = $pf_out6_block[5];
$in6_block_packets = $pf_in6_block[3];
$out6_block_packets = $pf_out6_block[3];
$ifinfo['inbytesblock'] = $in4_block + $in6_block;
$ifinfo['outbytesblock'] = $out4_block + $out6_block;
$ifinfo['inpktsblock'] = $in4_block_packets + $in6_block_packets;
$ifinfo['outpktsblock'] = $out4_block_packets + $out6_block_packets;
$ifinfo['inbytes'] = $in4_pass + $in6_pass;
$ifinfo['outbytes'] = $out4_pass + $out6_pass;
$ifinfo['inpkts'] = $in4_pass_packets + $in6_pass_packets;
$ifinfo['outpkts'] = $out4_pass_packets + $out6_pass_packets;
$ifconfiginfo = "";
$link_type = $config['interfaces'][$ifdescr]['ipaddr'];
switch ($link_type) {
......@@ -4787,51 +4752,11 @@ function get_interface_info($ifdescr)
}
if ($ifinfo['status'] == "up") {
/* try to determine media with ifconfig */
unset($ifconfiginfo);
exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo);
$wifconfiginfo = array();
if (is_interface_wireless($ifdescr)) {
exec("/sbin/ifconfig {$ifinfo['if']} list sta", $wifconfiginfo);
array_shift($wifconfiginfo);
}
$matches = "";
foreach ($ifconfiginfo as $ici) {
/* don't list media/speed for wireless cards, as it always
displays 2 Mbps even though clients can connect at 11 Mbps */
if (preg_match("/media: .*? \((.*?)\)/", $ici, $matches)) {
$ifinfo['media'] = $matches[1];
} elseif (preg_match("/media: Ethernet (.*)/", $ici, $matches)) {
$ifinfo['media'] = $matches[1];
} elseif (preg_match("/media: IEEE 802.11 Wireless Ethernet (.*)/", $ici, $matches)) {
$ifinfo['media'] = $matches[1];
}
if (preg_match("/status: (.*)$/", $ici, $matches)) {
if ($matches[1] != 'active') {
$ifinfo['status'] = $matches[1];
}
if ($ifinfo['status'] == 'running') {
$ifinfo['status'] = 'up';
}
}
if (preg_match("/channel (\S*)/", $ici, $matches)) {
$ifinfo['channel'] = $matches[1];
}
if (preg_match("/ssid (\".*?\"|\S*)/", $ici, $matches)) {
if ($matches[1][0] == '"') {
$ifinfo['ssid'] = substr($matches[1], 1, -1);
} else {
$ifinfo['ssid'] = $matches[1];
}
}
if (preg_match("/laggproto (.*)$/", $ici, $matches)) {
$ifinfo['laggproto'] = $matches[1];
}
if (preg_match("/laggport: (.*)$/", $ici, $matches)) {
$ifinfo['laggport'][] = $matches[1];
}
}
foreach ($wifconfiginfo as $ici) {
$elements = preg_split("/[ ]+/i", $ici);
if ($elements[0] != "") {
......@@ -4867,8 +4792,10 @@ function get_interface_info($ifdescr)
$ifinfo['bridgeint'] = $bridge;
}
}
$result[$ifdescr] = $ifinfo;
}
return $ifinfo;
return $result;
}
function convert_seconds_to_hms($sec)
......@@ -5028,35 +4955,14 @@ function get_ppp_uptime($port)
function is_ipaddr_configured($ipaddr, $ignore_if = '')
{
global $config;
$isipv6 = is_ipaddrv6($ipaddr);
if ($isipv6 === true) {
$interface_list_ips = get_configured_ipv6_addresses();
} else {
$if = get_real_interface($ignore_if);
$interface_list_ips = get_configured_ip_addresses();
}
foreach($interface_list_ips as $if => $ilips) {
/* Also ignore CARP interfaces, it'll be checked below */
if ($ignore_if == $if || strstr($ignore_if, "_vip")) {
continue;
}
if (strcasecmp($ipaddr, $ilips) == 0) {
return true;
}
}
$interface_list_vips = get_configured_vips_list(true);
foreach ($interface_list_vips as $id => $vip) {
if ($ignore_if == $vip['if']) {
continue;
}
if (strcasecmp($ipaddr, $vip['ipaddr']) == 0) {
if (empty($interface_list_ips[$ipaddr]) || $interface_list_ips[$ipaddr] == $if) {
return false;
} else {
return true;
}
}
return false;
}
/*
......
......@@ -273,8 +273,26 @@ function legacy_interfaces_details($intf = null)
return $a['link-local'] - $b['link-local'];
});
}
} elseif (preg_match("/media: (.*)/", $line, $matches)) {
// media, when link is between parenthesis grep only the link part
$result[$current_interface]['media'] = $matches[1];
if (preg_match("/media: .*? \((.*?)\)/", $line, $matches)) {
$result[$current_interface]['media'] = $matches[1];
}
} elseif (preg_match("/status: (.*)$/", $line, $matches)) {
$result[$current_interface]['status'] = $matches[1];
} elseif (preg_match("/channel (\S*)/", $line, $matches)) {
$result[$current_interface]['channel'] = $matches[1];
} elseif (preg_match("/ssid (\".*?\"|\S*)/", $line, $matches)) {
$result[$current_interface]['ssid'] = $matches[1];
} elseif (preg_match("/laggproto (.*)$/", $line, $matches)) {
$result[$current_interface]['laggproto'] = $matches[1];
} elseif (preg_match("/laggport: (.*)$/", $line, $matches)) {
if (empty($result[$current_interface]['laggport'])) {
$result[$current_interface]['laggport'] = array();
}
$result[$current_interface]['laggport'][] = $matches[1];
}
}
return $result;
......
......@@ -825,65 +825,26 @@ function get_configured_interface_with_descr($only_opt = false, $withdisabled =
/*
* get_configured_ip_addresses() - Return a list of all configured
* interfaces IP Addresses
* interfaces IP Addresses (ipv4+ipv6)
*
*/
function get_configured_ip_addresses()
{
global $config;
$ip_array = array();
$interfaces = get_configured_interface_list();
if (is_array($interfaces)) {
foreach($interfaces as $int) {
$ipaddr = get_interface_ip($int);
$ip_array[$int] = $ipaddr;
}
}
$interfaces = get_configured_carp_interface_list();
if (is_array($interfaces)) {
foreach($interfaces as $int => $ipaddr) {
$ip_array[$int] = $ipaddr;
}
}
/* pppoe server */
if (isset($config['pppoes']['pppoe'])) {
foreach($config['pppoes']['pppoe'] as $pppoe) {
if ($pppoe['mode'] == "server") {
if (is_ipaddr($pppoe['localip'])) {
$int = "pppoes". $pppoe['pppoeid'];
$ip_array[$int] = $pppoe['localip'];
foreach (legacy_interfaces_details() as $ifname => $if) {
foreach (array('ipv4', 'ipv6') as $iptype) {
if (!empty($if[$iptype])) {
foreach ($if[$iptype] as $addr) {
if (!empty($addr['ipaddr'])) {
$ip_array[$addr['ipaddr']] = $ifname;
}
}
}
}
return $ip_array;
}
/*
* get_configured_ipv6_addresses() - Return a list of all configured
* interfaces IPv6 Addresses
*
*/
function get_configured_ipv6_addresses()
{
$ipv6_array = array();
$interfaces = get_configured_interface_list();
if (is_array($interfaces)) {
foreach($interfaces as $int) {
$ipaddrv6 = get_interface_ipv6($int);
$ipv6_array[$int] = $ipaddrv6;
}
}
$interfaces = get_configured_carp_interface_list();
if (is_array($interfaces)) {
foreach($interfaces as $int => $ipaddrv6) {
$ipv6_array[$int] = $ipaddrv6;
}
}
return $ipv6_array;
return $ip_array;
}
/*
......@@ -935,17 +896,18 @@ function get_interface_list($only_active = false, $include_dmesg = false)
$ifnames_up = legacy_interface_listget('up');
$ifnames = legacy_interface_listget();
$all_interfaces = legacy_config_get_interfaces(array('virtual' => false));
$all_interface_data = legacy_interfaces_details();
if ($only_active) {
$_ifnames = array();
$all_stats = legacy_interface_stats();
foreach ($ifnames as $ifname) {
$ifinfo = legacy_interface_stats($ifname);
if ($ifinfo['link state'] == '2') {
$ifinfo = $all_stats[$ifname];
if (!empty($ifinfo['link state']) && $ifinfo['link state'] == '2') {
$_ifnames[] = $ifname;
}
}
$ifnames = $_ifnames;
}
......@@ -955,16 +917,15 @@ function get_interface_list($only_active = false, $include_dmesg = false)
continue;
}
$ifdata = legacy_get_interface_addresses($ifname);
$ifdata = !empty($all_interface_data[$ifname]) ? $all_interface_data[$ifname] : array();
$toput = array(
'up' => in_array($ifname, $ifnames_up),
'ipaddr' => !empty($ifdata['ipaddr']) ? $ifdata['ipaddr'] : null,
'mac' => $ifdata['macaddr'],
'ipaddr' => !empty($ifdata['ipv4'][0]['ipaddr']) ? $ifdata['ipv4'][0]['ipaddr'] : null,
'mac' => !empty($ifdata['macaddr']) ? $ifdata['macaddr'] : null,
'dmesg' => '',
);
foreach (legacy_config_get_interfaces(array('virtual' => false)) as $name => $int) {
foreach ($all_interfaces as $name => $int) {
if ($int['if'] == $ifname) {
$toput['friendly'] = $name;
break;
......
......@@ -111,9 +111,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$input_errors[] = gettext("A valid IP address must be specified.");
} else {
$ignore_if = isset($id) ? $a_vip[$id]['interface'] : $pconfig['interface'];
if ($pconfig['mode'] == 'carp') {
$ignore_if .= "_vip{$pconfig['vhid']}";
}
if (is_ipaddr_configured($pconfig['subnet'], $ignore_if)) {
$input_errors[] = gettext("This IP address is being used by another interface or VIP.");
}
......
......@@ -322,9 +322,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$interfaces = list_interfaces();
legacy_html_escape_form_data($interfaces);
$unused_interfaces= array();
$all_interfaces = legacy_config_get_interfaces();
foreach ($interfaces as $portname => $portinfo) {
$portused = false;
foreach (legacy_config_get_interfaces() as $ifname => $ifdata) {
foreach ($all_interfaces as $ifname => $ifdata) {
if ($ifdata['if'] == $portname) {
$portused = true;
break;
......
......@@ -94,7 +94,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($pconfig['port']) && !is_port($pconfig['port'])) {
$input_errors[] = gettext("A valid port number must be specified.");
}
if (!empty($pconfig['dnssrcip']) && !in_array($pconfig['dnssrcip'], get_configured_ip_addresses())) {
if (!empty($pconfig['dnssrcip']) && !in_array($pconfig['dnssrcip'], array_keys(get_configured_ip_addresses()))) {
$input_errors[] = gettext("An interface IP address must be specified for the DNS query source.");
}
if (count($input_errors) == 0) {
......
......@@ -64,8 +64,12 @@ include("head.inc");
<section class="col-xs-12">
<?php
$mac_man = json_decode(configd_run("interface list macdb json"), true);
$pfctl_counters = json_decode(configd_run("filter list counters json"), true);
$vmstat_interupts = json_decode(configd_run("system list interrupts json"), true);
$ifsinfo = get_interfaces_info();
foreach (get_configured_interface_with_descr(false, true) as $ifdescr => $ifname):
$ifinfo = get_interface_info($ifdescr);
$ifinfo = $ifsinfo[$ifdescr];
$ifpfcounters = $pfctl_counters[$ifinfo['if']];
legacy_html_escape_form_data($ifinfo);
$ifdescr = htmlspecialchars($ifdescr);
$ifname = htmlspecialchars($ifname);
......@@ -392,20 +396,20 @@ include("head.inc");
endif; ?>
<tr>
<td><?= gettext("In/out packets") ?></td>
<td> <?= $ifinfo['inpkts'] ?> / <?= $ifinfo['outpkts'] ?>
(<?= format_bytes($ifinfo['inbytes']);?> / <?=format_bytes($ifinfo['outbytes']);?> )
<td> <?= $ifpfcounters['inpkts'] ?> / <?= $ifpfcounters['outpkts'] ?>
(<?= format_bytes($ifpfcounters['inbytes']);?> / <?=format_bytes($ifpfcounters['outbytes']);?> )
</td>
</tr>
<tr>
<td><?= gettext("In/out packets (pass)") ?></td>
<td> <?= $ifinfo['inpktspass'] ?> / <?= $ifinfo['outpktspass'] ?>
(<?= format_bytes($ifinfo['inbytespass']) ?> / <?= format_bytes($ifinfo['outbytespass']) ?> )
<td> <?= $ifpfcounters['inpktspass'] ?> / <?= $ifpfcounters['outpktspass'] ?>
(<?= format_bytes($ifpfcounters['inbytespass']) ?> / <?= format_bytes($ifpfcounters['outbytespass']) ?> )
</td>
</tr>
<tr>
<td><?= gettext("In/out packets (block)") ?></td>
<td> <?= $ifinfo['inpktsblock'] ?> / <?= $ifinfo['outpktsblock'] ?>
(<?= format_bytes($ifinfo['inbytesblock']) ?> / <?= format_bytes($ifinfo['outbytesblock']) ?> )
<td> <?= $ifpfcounters['inpktsblock'] ?> / <?= $ifpfcounters['outpktsblock'] ?>
(<?= format_bytes($ifpfcounters['inbytesblock']) ?> / <?= format_bytes($ifpfcounters['outbytesblock']) ?> )
</td>
</tr>
<?php
......@@ -433,31 +437,34 @@ include("head.inc");
</tr>
<?php
endif;
if(file_exists("/usr/bin/vmstat")):
$real_interface = "";
$interrupt_total = "";
$interrupt_sec = "";
$real_interface = $ifinfo['if'];
$interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $3 }'`;
$interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $4 }'`;
if(strstr($interrupt_total, "hci")) {
$interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $4 }'`;
$interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $5 }'`;
}
unset($interrupt_total); // XXX: FIX ME! Need a regex and parse correct data 100% of the time.
if($interrupt_total): ?>
if (!empty($vmstat_interupts['interrupt_map'][$ifinfo['if']])):
$intrpts = $vmstat_interupts['interrupt_map'][$ifinfo['if']];?>
<tr>
<td><?= gettext("Interrupts per Second") ?></td>
<td><?= gettext("Interrupts") ?></td>
<td>
<?php
printf(gettext("%s total"),$interrupt_total);
echo "<br />";
printf(gettext("%s rate"),$interrupt_sec);
?>
<table class="table">
<thead>
<tr>
<th><?=gettext("irq");?></th>
<th><?=gettext("device");?></th>
<th><?=gettext("total");?></th>
<th><?=gettext("rate");?></th>
</tr>
</thead>
<?php
foreach ($intrpts as $intrpt):?>
<tr>
<td><?=$intrpt;?></td>
<td><?=implode(' ', $vmstat_interupts['interrupts'][$intrpt]['devices']);?></td>
<td><?=$vmstat_interupts['interrupts'][$intrpt]['total'];?></td>
<td><?=$vmstat_interupts['interrupts'][$intrpt]['rate'];?></td>
</tr>
<?php
endforeach; ?>
</table>
</td>
</tr>
<?php
endif;
endif; ?>
</tbody>
</table>
......
......@@ -31,15 +31,18 @@
function interfaces_api()
{
$result = array();
$ifsinfo = get_interfaces_info();
$pfctl_counters = json_decode(configd_run("filter list counters json"), true);
foreach (get_configured_interface_with_descr() as $ifdescr => $ifname) {
$ifinfo = get_interface_info($ifdescr);
$ifinfo = $ifsinfo[$ifdescr];
$ifpfcounters = $pfctl_counters[$ifinfo['if']];
$interfaceItem = array();
$interfaceItem['inpkts'] = $ifinfo['inpkts'];
$interfaceItem['outpkts'] = $ifinfo['outpkts'];
$interfaceItem['inbytes'] = $ifinfo['inbytes'];
$interfaceItem['outbytes'] = $ifinfo['outbytes'];
$interfaceItem['inbytes_frmt'] = format_bytes($ifinfo['inbytes']);
$interfaceItem['outbytes_frmt'] = format_bytes($ifinfo['outbytes']);
$interfaceItem['inpkts'] = $ifpfcounters['inpkts'];
$interfaceItem['outpkts'] = $ifpfcounters['outpkts'];
$interfaceItem['inbytes'] = $ifpfcounters['inbytes'];
$interfaceItem['outbytes'] = $ifpfcounters['outbytes'];
$interfaceItem['inbytes_frmt'] = format_bytes($ifpfcounters['inbytes']);
$interfaceItem['outbytes_frmt'] = format_bytes($ifpfcounters['outbytes']);
$interfaceItem['inerrs'] = isset($ifinfo['inerrs']) ? $ifinfo['inerrs'] : "0";
$interfaceItem['outerrs'] = isset($ifinfo['outerrs']) ? $ifinfo['outerrs'] : "0";
$interfaceItem['collisions'] = isset($ifinfo['collisions']) ? $ifinfo['collisions'] : "0";
......
......@@ -68,8 +68,9 @@ require_once("interfaces.inc");
<table class="table table-striped table-condensed" data-plugin="interfaces" data-callback="interface_widget_update">
<tbody>
<?php
$ifsinfo = get_interfaces_info();
foreach (get_configured_interface_with_descr() as $ifdescr => $ifname):
$ifinfo = get_interface_info($ifdescr);
$ifinfo = $ifsinfo[$ifdescr];
$iswireless = is_interface_wireless($ifdescr);?>
<tr id="interface_widget_item_<?=$ifname;?>">
<td>
......
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