Bug 292019 - Removing vlan iftagged/ifuntagged fails if vlanfilter is off
Summary: Removing vlan iftagged/ifuntagged fails if vlanfilter is off
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Lexi Winter
URL: https://reviews.freebsd.org/D54435
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-29 14:12 UTC by Zoë Cat
Modified: 2026-02-22 01:13 UTC (History)
2 users (show)

See Also:
ivy: mfc-stable15+
ivy: mfc-stable14-
ivy: mfc-stable13-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zoë Cat 2025-12-29 14:12:05 UTC
While tinkering with bridges I found I was unable to unset iftagged if I had previously turned off vlanfilter:

# ifconfig br0 iftagged re0 none
ifconfig: BRDGSIFVLANSET 2: Invalid argument (extended error VLAN filtering not enabled)

However, it seems like I can enable and disable in the same line to achieve the desired effect:

# ifconfig br0 vlanfilter iftagged re0 none -vlanfilter
(success)

(I had renamed my bridge from bridge0 to br0 for no particular reason.)
Comment 1 Lexi Winter freebsd_committer freebsd_triage 2025-12-31 02:56:27 UTC
we should just allow BRDGSIFVLANSET regardless of IFBRF_VLANFILTER state; it has no effect, but there's no reason to disallow it.  i think this might be a relic from when vlanfilter was a per-interface flag.
Comment 2 commit-hook freebsd_committer freebsd_triage 2026-01-03 02:58:12 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2e92aeede85c8986bd6f4dde65d2ac2449eccf51

commit 2e92aeede85c8986bd6f4dde65d2ac2449eccf51
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2026-01-03 01:13:22 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2026-01-03 02:57:16 +0000

    bridge: Allow BRDGSIFVLANSET without IFBRF_VLANFILTER

    Currently, we disallow BRDGSIFVLANSET when IFBRF_VLANFILTER is disabled.
    There's no particular reason to do this, and it causes some undesirable
    behaviour such as not being able to remove the tagged config on a member
    after disabling vlanfilter on the bridge.

    Remove the restriction so BRDGSIFVLANSET is always accepted.

    PR:     292019
    MFC after:      1 week
    Reviewed by:    zlei, p.mousavizadeh_protonmail.com
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D54435

 sys/net/if_bridge.c | 3 ---
 1 file changed, 3 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-02-22 01:12:12 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=34565dd970f648020074af9abf6d960fa3a2e189

commit 34565dd970f648020074af9abf6d960fa3a2e189
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2026-01-03 01:13:22 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2026-02-22 00:49:46 +0000

    bridge: Allow BRDGSIFVLANSET without IFBRF_VLANFILTER

    Currently, we disallow BRDGSIFVLANSET when IFBRF_VLANFILTER is disabled.
    There's no particular reason to do this, and it causes some undesirable
    behaviour such as not being able to remove the tagged config on a member
    after disabling vlanfilter on the bridge.

    Remove the restriction so BRDGSIFVLANSET is always accepted.

    PR:     292019
    MFC after:      1 week
    Reviewed by:    zlei, p.mousavizadeh_protonmail.com
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D54435

    (cherry picked from commit 2e92aeede85c8986bd6f4dde65d2ac2449eccf51)

 sys/net/if_bridge.c | 3 ---
 1 file changed, 3 deletions(-)