Bug 290141 - ifconfig w/ new if_bridge logic erroneously providing error
Summary: ifconfig w/ new if_bridge logic erroneously providing error
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Lexi Winter
URL: https://reviews.freebsd.org/D53049
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-11 06:32 UTC by pprocacci
Modified: 2025-10-13 07:07 UTC (History)
3 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 pprocacci 2025-10-11 06:32:48 UTC
Scenario here is:

Create a bridge without `vlanfilter'.

# ifconfig bridge1
bridge1: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        options=10<VLAN_HWTAGGING>
        ether 58:9c:fc:10:df:aa
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        bridge flags=0<>
        member: epair2a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                port 30 priority 128 path cost 2000 vlan protocol 802.1q untagged 1843
        member: epair1a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                port 14 priority 128 path cost 2000 vlan protocol 802.1q
        groups: bridge
        nd6 options=9<PERFORMNUD,IFDISABLED>



I added epair2a w/ `untagged 1843' to the bridge erroneously as shown above.
Went to remove the tag which yielded the following error:

# ifconfig bridge1 -ifuntagged epair2a 1843
ifconfig: ERROR: setting interface address without mask is no longer supported.


Though the tag removal was still successful:

# ifconfig bridge1
bridge1: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
        options=10<VLAN_HWTAGGING>
        ether 58:9c:fc:10:df:aa
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        bridge flags=0<>
        member: epair2a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                port 30 priority 128 path cost 2000 vlan protocol 802.1q
        member: epair1a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                port 14 priority 128 path cost 2000 vlan protocol 802.1q
        groups: bridge
        nd6 options=9<PERFORMNUD,IFDISABLED>
Comment 1 Lexi Winter freebsd_committer freebsd_triage 2025-10-12 15:09:16 UTC
the ifconfig syntax is wrong, do not include vlan-id:

# ifconfig epair create
epair3a
# ifconfig bridge create
bridge1
# ifconfig bridge1 addm epair3a untagged 100
# ifconfig bridge1 | grep -A1 epair3a
   member: epair3a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
           port 13 priority 128 path cost 2000 vlan protocol 802.1q untagged 100
# ifconfig bridge1 -ifuntagged epair3a
# ifconfig bridge1 | grep -A1 epair3a
   member: epair3a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
           port 13 priority 128 path cost 2000 vlan protocol 802.1q

however this isn't your fault, because the documentation for -ifuntagged in bridge(4) is wrong.  sorry about that.

the reason you get a confusing error is because ifconfig thinks you want to assign the IP address "1843" to the bridge, but you didn't specify a netmask for that address.  i'm not sure this is practical to fix in ifconfig, at least right now, since the syntax is quite ambiguous and the parser is... rudimentary.
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-10-13 06:01:13 UTC
A commit in branch main references this bug:

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

commit dc978c5cb55b75d292c7ef32564f5c376685234b
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-10-13 05:57:57 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2025-10-13 06:01:01 +0000

    bridge.4: Fix the synopsis for -ifuntagged

    This command doesn't accept a vlan-id.

    PR:     290141
    MFC after:      3 days
    Reported by:    Paul Procacci <pprocacci@gmail.com>
    Reviewed by:    ziaee (manpages)
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D53049

 sbin/ifconfig/ifconfig.8 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-10-13 06:51:21 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=53fcc7f9b0de48449ff3c80140448dd620f44214

commit 53fcc7f9b0de48449ff3c80140448dd620f44214
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-10-13 05:57:57 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2025-10-13 06:34:24 +0000

    bridge.4: Fix the synopsis for -ifuntagged

    This command doesn't accept a vlan-id.

    PR:     290141
    MFC after:      3 days
    Reported by:    Paul Procacci <pprocacci@gmail.com>
    Reviewed by:    ziaee (manpages)
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D53049

    (cherry picked from commit dc978c5cb55b75d292c7ef32564f5c376685234b)

 sbin/ifconfig/ifconfig.8 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 4 Lexi Winter freebsd_committer freebsd_triage 2025-10-13 07:00:08 UTC
MFC'd early to fit into the next batch of commits for 15.0-BETA2.

thanks for the report.
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-10-13 07:07:26 UTC
A commit in branch releng/15.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=0fa9385d10c530cccb36aef602840a7c0a094513

commit 0fa9385d10c530cccb36aef602840a7c0a094513
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-10-13 05:57:57 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-10-13 07:06:21 +0000

    bridge.4: Fix the synopsis for -ifuntagged

    This command doesn't accept a vlan-id.

    Approved by:    re (cperciva)
    PR:     290141
    MFC after:      3 days
    Reported by:    Paul Procacci <pprocacci@gmail.com>
    Reviewed by:    ziaee (manpages)
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D53049

    (cherry picked from commit dc978c5cb55b75d292c7ef32564f5c376685234b)
    (cherry picked from commit 53fcc7f9b0de48449ff3c80140448dd620f44214)

 sbin/ifconfig/ifconfig.8 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)