Commit da3b10c6 authored by Franco Fichtner's avatar Franco Fichtner

interfaces: fix crash report and deprecate 'hwif' ifinfo element

parent 4725b679
......@@ -4912,10 +4912,11 @@ function get_interface_info($ifdescr)
global $config;
$ifinfo = array();
if (empty($config['interfaces'][$ifdescr])) {
return;
}
$ifinfo['hwif'] = $config['interfaces'][$ifdescr]['if'];
$ifinfo['if'] = get_real_interface($ifdescr);
$chkif = $ifinfo['if'];
......@@ -4925,7 +4926,7 @@ function get_interface_info($ifdescr)
$ifinfo['subnet'] = $ifinfotmp['subnet'];
$ifup = legacy_interface_listget('up');
$ifinfo['status'] = in_array($chkif, $ifup) ? 'up' : 'down';
$ifinfo['status'] = (is_array($ifup) && in_array($chkif, $ifup)) ? 'up' : 'down';
$ifinfo['linklocal'] = get_interface_linklocal($ifdescr);
$ifinfo['ipaddrv6'] = get_interface_ipv6($ifdescr);
......
......@@ -80,7 +80,7 @@ include("head.inc");
<tr>
<th colspan="2">
<i class="fa fa-chevron-down" style="cursor: pointer;" data-toggle="collapse" data-target="#<?= htmlspecialchars($ifname) ?>"></i>
<?= htmlspecialchars($ifname) ?> <?= gettext("interface") ?> (<?= htmlspecialchars($ifdescr) ?>, <?= htmlspecialchars($ifinfo['hwif']) ?>)
<?= htmlspecialchars($ifname) ?> <?= gettext("interface") ?> (<?= htmlspecialchars($ifdescr) ?>, <?= htmlspecialchars($ifinfo['if']) ?>)
<?php
if (!isset($first_row)):
$first_row=false; ?>
......@@ -440,7 +440,7 @@ include("head.inc");
$real_interface = "";
$interrupt_total = "";
$interrupt_sec = "";
$real_interface = $ifinfo['hwif'];
$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")) {
......
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