Commit 96510573 authored by Franco Fichtner's avatar Franco Fichtner

interfaces: port status-only probe

(cherry picked from commit 9b94d2f2)
(cherry picked from commit 3272c7bb)
parent c4b22a4c
...@@ -2688,10 +2688,10 @@ EOD; ...@@ -2688,10 +2688,10 @@ EOD;
} }
/* find which clones are up and bring them down */ /* find which clones are up and bring them down */
$ifup = legacy_interface_listget('up');
$clones_up = array(); $clones_up = array();
foreach ($clone_list as $clone_if) { foreach ($clone_list as $clone_if) {
$clone_status = pfSense_get_interface_addresses($clone_if); if (in_array($clone_if, $ifup)) {
if ($clone_status['status'] == 'up') {
$clones_up[] = $clone_if; $clones_up[] = $clone_if;
mwexec("{$ifconfig} " . escapeshellarg($clone_if) . " down"); mwexec("{$ifconfig} " . escapeshellarg($clone_if) . " down");
} }
...@@ -5086,19 +5086,20 @@ function get_interface_info($ifdescr) ...@@ -5086,19 +5086,20 @@ function get_interface_info($ifdescr)
$chkif = $ifinfo['if']; $chkif = $ifinfo['if'];
$ifinfotmp = pfSense_get_interface_addresses($chkif); $ifinfotmp = pfSense_get_interface_addresses($chkif);
$ifinfo['status'] = $ifinfotmp['status'];
if (empty($ifinfo['status'])) {
$ifinfo['status'] = 'down';
}
$ifinfo['macaddr'] = $ifinfotmp['macaddr']; $ifinfo['macaddr'] = $ifinfotmp['macaddr'];
$ifinfo['ipaddr'] = $ifinfotmp['ipaddr']; $ifinfo['ipaddr'] = $ifinfotmp['ipaddr'];
$ifinfo['subnet'] = $ifinfotmp['subnet']; $ifinfo['subnet'] = $ifinfotmp['subnet'];
$ifinfo['linklocal'] = get_interface_linklocal($ifdescr);
$ifinfo['ipaddrv6'] = get_interface_ipv6($ifdescr);
$ifinfo['subnetv6'] = get_interface_subnetv6($ifdescr);
if (isset($ifinfotmp['link0'])) { if (isset($ifinfotmp['link0'])) {
$link0 = 'down'; $link0 = 'down';
} }
$ifup = legacy_interface_listget('up');
$ifinfo['status'] = in_array($chkif, $ifup) ? 'up' : 'down';
$ifinfo['linklocal'] = get_interface_linklocal($ifdescr);
$ifinfo['ipaddrv6'] = get_interface_ipv6($ifdescr);
$ifinfo['subnetv6'] = get_interface_subnetv6($ifdescr);
$ifinfotmp = legacy_interface_stats($chkif); $ifinfotmp = legacy_interface_stats($chkif);
$ifinfo['inerrs'] = $ifinfotmp['input errors']; $ifinfo['inerrs'] = $ifinfotmp['input errors'];
$ifinfo['outerrs'] = $ifinfotmp['output errors']; $ifinfo['outerrs'] = $ifinfotmp['output errors'];
......
...@@ -902,10 +902,8 @@ function get_interface_list($only_active = false) ...@@ -902,10 +902,8 @@ function get_interface_list($only_active = false)
foreach ($ifnames as $ifname) { foreach ($ifnames as $ifname) {
$ifinfo = legacy_interface_stats($ifname); $ifinfo = legacy_interface_stats($ifname);
if (isset($ifinfo['link state'])) { if ($ifinfo['link state'] == '2') {
if ($ifinfo['link state'] == '2') { $_ifnames[] = $ifname;
$_ifnames[] = $ifname;
}
} }
} }
......
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