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