[Bug 263667] ifconfig: group flags -g and -G not consistent with expectation or man page

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 30 Apr 2022 03:33:19 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263667

            Bug ID: 263667
           Summary: ifconfig: group flags -g and -G not consistent with
                    expectation or man page
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: jeff+freebsd@wagsky.com

FreeBSD js1 13.1-RC4 FreeBSD 13.1-RC4 releng/13.1-n250133-283d1b98251 GENERIC
amd64


The group-selection flags' behavior is not sufficient to get a simple
(actionable) 
list of interfaces that are members of one group and not another. 
The man page, as I understand it, suggests that this should be possible.


[jeff@js1 ~/devel/jail-networking]$ /sbin/ifconfig -g @jname-si-real -G bridge
vif0
vif0/jname-si-
bridge6

Expected vif0 and vif0/jname-si-


[jeff@js1 ~/devel/jail-networking]$ /sbin/ifconfig -a -g @jname-si-real -G
bridge
vif0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 02:c1:6f:13:e8:0a
        groups: epair @jname-si-real
        media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
vif0/jname-si-: flags=8963<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST>
metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 02:c1:6f:13:e8:0b
        groups: epair @jname-si-real
        media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Works, but needs to be processed as text to become an actionable list
sus as `for lvar in $(/sbin/ifconfig some args) ; do `


For reference

[jeff@js1 ~/devel/jail-networking]$ ifconfig bridge6
bridge6: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 58:9c:fc:10:28:6c
        id 00:0d:b9:48:62:b5 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:0d:b9:48:62:b5 priority 32768 ifcost 0 port 0
        member: vif0/jname-si-
flags=1e7<LEARNING,DISCOVER,STP,EDGE,AUTOEDGE,PTP,AUTOPTP>
                ifmaxaddr 0 port 29 priority 128 path cost 2000 proto rstp
                role designated state forwarding
        member: igb1.6
flags=1e7<LEARNING,DISCOVER,STP,EDGE,AUTOEDGE,PTP,AUTOPTP>
                ifmaxaddr 0 port 19 priority 128 path cost 20000 proto rstp
                role designated state forwarding
        groups: bridge @jname-si-real
        nd6 options=9<PERFORMNUD,IFDISABLED>

-- 
You are receiving this mail because:
You are the assignee for the bug.