#9087·luci

luci-mod-network: bridge port "Multicast routing: Never" does not disable the port and deletes a manually set 0

Author: qjebbsCreated Sep 29, 2026Updated Sep 29, 2026

Is there an existing issue for this?

  • I have searched among all existing issues (including closed issues)

screenshots or captures

No response

Actual behaviour

Two problems with the same root cause, on the device config page of a bridge port (Network → Devices → <port> → Configure → tab "Bridge port specific options"):

  1. "Never" does not disable anything. The dropdown stores an empty value for "Never", so the UCI option is never written. The kernel then falls back to its default 1 (= Learn), meaning the port is still treated as a multicast router port whenever it receives a general IGMP query. Verified: after selecting "Never" and saving, /etc/config/network contains no multicast_router for that device and /sys/class/net/<port>/brport/multicast_router reads 1.
  2. An existing multicast_router '0' is silently deleted. 0 is not one of the choices, so the widget renders with nothing selected; pressing Save removes the option (empty form value ⇒ remove) and the port goes from 0 (disabled) back to the kernel default 1 (Learn). There is no way to keep the setting: once the port's device page has been opened and saved, the manual value is gone.

Impact: users who follow the usual "disable mrouter on this port to stop IGMP-snooping induced multicast flooding" advice end up with a port that is still an mrouter port, and any value they set by hand is lost without any message.

Root cause

modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js:1314:

javascript
o = this.replaceOption(s, 'brport', form.ListValue, 'multicast_router', _('Multicast routing'));
o.value('', _('Never'));
o.value('1', _('Learn'));
o.value('2', _('Always'));
o.depends('multicast', /1/);

There is no '0' choice, and "Never" uses the empty string. In modules/luci-base/htdocs/luci-static/resources/form.js, AbstractValue defaults to this.rmempty = true (line 1431) and AbstractValue.parse() removes the option when the form value is empty (line ~2153):

javascript
if (fval == null || fval == '' || (fval == this.default && (this.optional || this.rmempty))) {
    if (this.rmempty || this.optional)
        return Promise.resolve(this.remove(section_id));

The kernel/netifd semantics are 0 = never (disabled), 1 = learn (auto), 2 = always (permanent): netifd/device.c documents Use 0: never, 1: learn, 2: always, and it only writes brport/multicast_router when the option is present. When the option is absent the value stays at the kernel init default MDB_RTR_TYPE_TEMP_QUERY (= 1, Learn) from br_multicast_port_ctx_init(). So "absent" is not equivalent to "0" — which is what the "Never" entry assumes.

(The same remove()-when-inactive path also drops the option when the field is hidden by o.depends('multicast', /1/), i.e. when "Enable multicast support" is off on that device.)

Expected behaviour

  1. An Auto (Learn) dropdown option should be added as default.
  2. Selecting "Never" should store option multicast_router '0', so the port is really disabled (/sys/class/net/<port>/brport/multicast_router == 0).

Steps to reproduce

  1. Create a bridge with one port and disable mrouter on that port:
config device
    option name 'br-lan'
    option type 'bridge'
    list ports 'eth1'
    option igmp_snooping '1'

config device
    option name 'eth1'
    option multicast_router '0'
  1. uci commit network && /etc/init.d/network reload
  2. Verify the setting took effect: cat /sys/class/net/eth1/brport/multicast_router → 0
  3. LuCI: Network → Devices → eth1 → Configure, switch to the tab "Bridge port specific options": the "Multicast routing" dropdown shows nothing selected (there is no entry matching the stored 0).
  4. Press Save & Apply without changing anything.
  5. Result: uci show network | grep multicast_router → the eth1 entry is gone, and cat /sys/class/net/eth1/brport/multicast_router → 1 (Learn). In the same dropdown, selecting "Never" and saving does not write the option either, so the port also stays at 1.

Additional Information

bash
{
        "kernel": "6.12.87",
        "hostname": "OpenWrt",
        "system": "Intel(R) Pentium(R) CPU  N3710  @ 1.60GHz",
        "model": "AMI Corporation Aptio CRB",
        "board_name": "ami-corporation-aptio-crb",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "25.12.4",
                "firmware_url": "https://downloads.openwrt.org/",
                "revision": "r32933-4ccb782af7",
                "target": "x86/64",
                "description": "OpenWrt 25.12.4 r32933-4ccb782af7",
                "builddate": "1778712129"
        }
}
luci-base: luci-base-26.133.20346~e9ebca7
luci-mod-network: luci-mod-network-26.133.20346~e9ebca7


Also reproducible with current `master` (the `o.value('', _('Never'))` line is still
present there as of 2026-09-29).

What browsers do you see the problem on?

No response

Relevant log output

bash
Not applicable — the effect is visible in `/etc/config/network` and in
`/sys/class/net/<port>/brport/multicast_router` (no console errors).