Actions
Bug #16309
openstatus_interfaces.php includes VLAN switchport information even when no physical switch is present on the platform (the config.xml was imported from platform with switch)
Status:
Confirmed
Priority:
Very Low
Assignee:
-
Category:
Web Interface
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Release Notes:
Default
Affected Plus Version:
25.07
Affected Architecture:
Description
I just noticed a very minor display issue in 25.07.b.20250707.2346. On the Interface Status page every VLAN interface shows a switchport configuration, which is unexpected as my current platform doesn't have a switch. But as the current configuration was imported from a Netgate 2100 it gives the issue some context, and a resonable explaination.
With this small patch, the VLAN information is displayed correctly:
--- /usr/local/www/status_interfaces.php 2025-07-04 16:32:50.000000000 +0200
+++ /usr/local/www/status_interfaces.php.new 2025-07-12 16:40:51.111525000 +0200
@@ -117,6 +117,13 @@
$shortcut_section = "interfaces";
include("head.inc");
+/* Check that a switch exists, not just in the configuration */
+$have_switch = true;
+$swdevices = switch_get_devices();
+$swinfo = pfSense_etherswitch_getinfo($swdevice);
+if ($swinfo == NULL) {
+ $have_switch = false;
+}
$ifdescrs = get_configured_interface_with_descr(true);
$ifinterrupts = interfaces_interrupts();
$switch_config = config_get_path('switches/switch/0/vlangroups/vlangroup', []);
@@ -133,7 +140,7 @@
$ifhwinfo = $ifinfo['hwif'];
$vlan = interface_is_vlan($ifinfo['hwif']);
- if ($vlan) {
+ if ($vlan && $have_switch) {
foreach ($switch_config as $vlangroup) {
if ($vlangroup['vlanid'] == $vlan['tag']) {
$ifhwinfo .= ', switchports: ' . $vlangroup['members'];
Fix applied:
Files
Actions