Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VLAN filtering checkbox does not reflect config file setting: vlan_filtering='1' shows checkbox empty. #7278

Open
vsessink opened this issue Sep 13, 2024 · 6 comments

Comments

@vsessink
Copy link

Steps to reproduce:

  1. got to NetworkInterfaces and click the Devices tab
  2. Click the Configure button for br-lan
  3. Click the Bridge VLAN filtering tab
  4. Click the Enable VLAN filtering box
  5. Click on the [Save] button

Note that the UNSAVED CHANGES field now has 1 change: uci set network.cfg030f15.vlan_filtering='1'. So click Save & Apply in order to apply the setting.

Actual behavior:

  1. Device br-lan will now have option vlan_filtering '1',
  2. The Luci UI does not reflect that. Click the Configure button for br-lan again, note that Enable VLAN filtering is off, i.e. not checked.

Expected behavior:

The Luci UI shows that Enable VLAN filtering is on, i.e. checked if vlan_filtering is 1.

Additional Information:

DISTRIB_ID='OpenWrt' DISTRIB_RELEASE='23.05.3' DISTRIB_REVISION='r23809-234f1a2efa'
DISTRIB_TARGET='mediatek/filogic' DISTRIB_ARCH='aarch64_cortex-a53' 
DISTRIB_DESCRIPTION='OpenWrt 23.05.3 r23809-234f1a2efa'
DISTRIB_TAINTS=''

@systemcrash
Copy link
Contributor

Does the change reflect in your underlying config?

@vsessink
Copy link
Author

Yes, it does, as stated under Actual Behavior: Device br-lan will now have option vlan_filtering '1'
So the configuration changes but the filtering checkbox stays empty as if no config change happened.

@systemcrash
Copy link
Contributor

The config... file. Check what it says in /etc/config/network

@vsessink
Copy link
Author

vsessink commented Sep 14, 2024

Sorry for - apparently - not being clear enough. Yes, the configuration file actually changes, but the checkbox doesn't reflect this change.

So to make it very clear, before the change the br-lan entry in the config file /etc/config/network looks like:

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'

Then after checking the checkbox enable vlan filtering in Luci and clicking save and save & apply, the br-lan config in the file /etc/config/network looks like:

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	option vlan_filtering '1'

But the enable vlan filtering configuration option in Luci still shows an unchecked box.

@systemcrash
Copy link
Contributor

Then I imagine if you add some VLANs to that config, the setting makes sense. The code for this has:

		o.updateDefaultValue = function(section_id) {
			var device = uci.get('network', s.section, 'name'),
			    uielem = this.getUIElement(section_id),
			    has_vlans = false;

			uci.sections('network', 'bridge-vlan', function(bvs) {
				has_vlans = has_vlans || (bvs.device == device);
			});

			this.default = has_vlans ? this.enabled : this.disabled;

			if (uielem && !uielem.isChanged())
				uielem.setValue(this.default);
		};

Try also adding a VLAN. What happens?

@vsessink
Copy link
Author

Yep, it switches on. Doesn't it do anything, besides setting a configuration option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants