Commit f15eb3b2 authored by Ad Schellevis's avatar Ad Schellevis

get_interfaces_info() only overwrite status code when reported status in...

get_interfaces_info() only overwrite status code when reported status in 'active','running' for https://github.com/opnsense/core/issues/1662
parent f7cf3c90
......@@ -4631,11 +4631,13 @@ function get_interfaces_info()
foreach (legacy_config_get_interfaces(array("virtual" => false)) as $ifdescr => $ifcnf) {
$ifinfo = array();
$ifinfo['if'] = get_real_interface($ifdescr);
$ifstatus = (is_array($ifup) && in_array($ifinfo['if'], $ifup)) ? 'up' : 'down';
if (!empty($all_intf_details[$ifinfo['if']])) {
$ifinfo = array_merge($ifinfo, $all_intf_details[$ifinfo['if']]);
if (in_array($ifinfo['status'], array('active', 'running'))) {
$ifinfo['status'] = $ifstatus;
}
}
$ifinfo['status'] = (is_array($ifup) && in_array($ifinfo['if'], $ifup)) ? 'up' : 'down';
if (!empty($ifinfo['ipv6'])) {
foreach ($ifinfo['ipv6'] as $ipv6addr) {
......
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