From nobody Sun Dec 3 02:29:20 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SjW2m5zplz52Xgj for ; Sun, 3 Dec 2023 02:29:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SjW2m4CKNz3fKP for ; Sun, 3 Dec 2023 02:29:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701570560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UEdxweCcGHNK9NKXA1trTCQ8U2bR1CLsjlBhE+7S28E=; b=LNnc+y/+5vJ/Orwp+uItHlAAcfhruPQp37Qbd1dkECk9VKb7pTs6u7OFiudJFPaJPTAN/f q54mmwIg0Gkh5rheFquovBlU5wtIDIovz3YMRbio3ptJCDALTc8XmRTgAxpnaaRfEsr071 sAAX477Mr5a/eH4Lt+ioQx9NB5rkd+7n+OOAP8Z1sK7sdi49zwiMt5zsisSdXtnkG0ZMIZ ISCSqn+PQuncGmjm42gtqmTe5PLQHmvdvCx95dxejfIBs6t1wZqIrnzaFcirS9mB+sIsS2 zA7NoIY11pSmGOxG72CqrwhKdc94lLXBpj25wDl/oVNMg60yx2piHPc8U62rUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701570560; a=rsa-sha256; cv=none; b=UHAnyN9LytaaDXuqVsNx25/jv36+1dvN2svXQoll2no7EfAk9Ua5r+ghg2vUlEODTVVwjG AcGsfhxtlK6IlVN9uXgitnsyTFvfE57aXRLiSBp/y1m2+BcO2506kwx5/K7t+CTI5G/spl HklUemJBUCYGLQUjBJoUF5jFKgOy2Fn+4xVPhQrFccMeg0pvfFPBIJi9IMJseb2lFY78Mk +i2JXkvRVcEt1KXVS5+eewLX/tOK0xNUHlsLa1EQJ5iBvtX2cCte5SaC470fvoNHnLZ9W4 spUPz0JgCB1dEVcphVBmWb6l6jX1q4104noOUetnRr3OdpEhKnwcXHKyJpSzGA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SjW2m30jXzh9y for ; Sun, 3 Dec 2023 02:29:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 3B32TKPr042623 for ; Sun, 3 Dec 2023 02:29:20 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3B32TKiB042622 for bugs@FreeBSD.org; Sun, 3 Dec 2023 02:29:20 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 275491] ifconfig(8) only shows 101 members of a bridge Date: Sun, 03 Dec 2023 02:29:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 14.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: DtxdF@disroot.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275491 Bug ID: 275491 Summary: ifconfig(8) only shows 101 members of a bridge Product: Base System Version: 14.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: DtxdF@disroot.org Created attachment 246735 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D246735&action= =3Dedit libifconfig_bridge.diff Description: I have written a script to create a bridge and a thousand of tap(4) interfa= ces, each added as a member of that bridge. When ifconfig(8) is run with the bri= dge name as the first argument, the output shows only 101 members. The members = are added correctly even though they are not shown in the output of ifconfig(8), since I tried to add a member that is not shown in the output and ifconfig(= 8) returns `File exists`. Steps to reproduce this issue: ``` # cat bridge.sh #!/bin/sh total=3D1000 bridge=3D$(ifconfig bridge create) echo "${bridge}" for n in `jot ${total}`; do ifconfig "${bridge}" addm $(ifconfig tap create) done # ./bridge.sh bridge2 # ifconfig bridge2 bridge2: flags=3D8802 metric 0 mtu 1500 ether 58:9c:fc:00:34:14 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 0 ifcost 0 port 0 member: tap1000 flags=3D143 ifmaxaddr 0 port 250 priority 128 path cost 2000000 member: tap999 flags=3D143 ifmaxaddr 0 port 249 priority 128 path cost 2000000 member: tap998 flags=3D143 ifmaxaddr 0 port 248 priority 128 path cost 2000000 member: tap997 flags=3D143 ifmaxaddr 0 port 247 priority 128 path cost 2000000 member: tap996 flags=3D143 ifmaxaddr 0 port 246 priority 128 path cost 2000000 member: tap995 flags=3D143 ifmaxaddr 0 port 245 priority 128 path cost 2000000 member: tap994 flags=3D143 ifmaxaddr 0 port 244 priority 128 path cost 2000000 member: tap993 flags=3D143 ifmaxaddr 0 port 243 priority 128 path cost 2000000 member: tap992 flags=3D143 ifmaxaddr 0 port 242 priority 128 path cost 2000000 member: tap991 flags=3D143 ifmaxaddr 0 port 241 priority 128 path cost 2000000 member: tap990 flags=3D143 ifmaxaddr 0 port 240 priority 128 path cost 2000000 member: tap989 flags=3D143 ifmaxaddr 0 port 239 priority 128 path cost 2000000 member: tap988 flags=3D143 ifmaxaddr 0 port 238 priority 128 path cost 2000000 member: tap987 flags=3D143 ifmaxaddr 0 port 237 priority 128 path cost 2000000 member: tap986 flags=3D143 ifmaxaddr 0 port 236 priority 128 path cost 2000000 member: tap985 flags=3D143 ifmaxaddr 0 port 235 priority 128 path cost 2000000 member: tap984 flags=3D143 ifmaxaddr 0 port 234 priority 128 path cost 2000000 member: tap983 flags=3D143 ifmaxaddr 0 port 233 priority 128 path cost 2000000 member: tap982 flags=3D143 ifmaxaddr 0 port 232 priority 128 path cost 2000000 member: tap981 flags=3D143 ifmaxaddr 0 port 231 priority 128 path cost 2000000 member: tap980 flags=3D143 ifmaxaddr 0 port 230 priority 128 path cost 2000000 member: tap979 flags=3D143 ifmaxaddr 0 port 229 priority 128 path cost 2000000 member: tap978 flags=3D143 ifmaxaddr 0 port 228 priority 128 path cost 2000000 member: tap977 flags=3D143 ifmaxaddr 0 port 227 priority 128 path cost 2000000 member: tap976 flags=3D143 ifmaxaddr 0 port 226 priority 128 path cost 2000000 member: tap975 flags=3D143 ifmaxaddr 0 port 225 priority 128 path cost 2000000 member: tap974 flags=3D143 ifmaxaddr 0 port 224 priority 128 path cost 2000000 member: tap973 flags=3D143 ifmaxaddr 0 port 223 priority 128 path cost 2000000 member: tap972 flags=3D143 ifmaxaddr 0 port 222 priority 128 path cost 2000000 member: tap971 flags=3D143 ifmaxaddr 0 port 221 priority 128 path cost 2000000 member: tap970 flags=3D143 ifmaxaddr 0 port 220 priority 128 path cost 2000000 member: tap969 flags=3D143 ifmaxaddr 0 port 219 priority 128 path cost 2000000 member: tap968 flags=3D143 ifmaxaddr 0 port 218 priority 128 path cost 2000000 member: tap967 flags=3D143 ifmaxaddr 0 port 217 priority 128 path cost 2000000 member: tap966 flags=3D143 ifmaxaddr 0 port 216 priority 128 path cost 2000000 member: tap965 flags=3D143 ifmaxaddr 0 port 215 priority 128 path cost 2000000 member: tap964 flags=3D143 ifmaxaddr 0 port 214 priority 128 path cost 2000000 member: tap963 flags=3D143 ifmaxaddr 0 port 213 priority 128 path cost 2000000 member: tap962 flags=3D143 ifmaxaddr 0 port 212 priority 128 path cost 2000000 member: tap961 flags=3D143 ifmaxaddr 0 port 211 priority 128 path cost 2000000 member: tap960 flags=3D143 ifmaxaddr 0 port 210 priority 128 path cost 2000000 member: tap959 flags=3D143 ifmaxaddr 0 port 209 priority 128 path cost 2000000 member: tap958 flags=3D143 ifmaxaddr 0 port 208 priority 128 path cost 2000000 member: tap957 flags=3D143 ifmaxaddr 0 port 207 priority 128 path cost 2000000 member: tap956 flags=3D143 ifmaxaddr 0 port 206 priority 128 path cost 2000000 member: tap955 flags=3D143 ifmaxaddr 0 port 205 priority 128 path cost 2000000 member: tap954 flags=3D143 ifmaxaddr 0 port 204 priority 128 path cost 2000000 member: tap953 flags=3D143 ifmaxaddr 0 port 203 priority 128 path cost 2000000 member: tap952 flags=3D143 ifmaxaddr 0 port 202 priority 128 path cost 2000000 member: tap951 flags=3D143 ifmaxaddr 0 port 201 priority 128 path cost 2000000 member: tap950 flags=3D143 ifmaxaddr 0 port 200 priority 128 path cost 2000000 member: tap949 flags=3D143 ifmaxaddr 0 port 199 priority 128 path cost 2000000 member: tap948 flags=3D143 ifmaxaddr 0 port 198 priority 128 path cost 2000000 member: tap947 flags=3D143 ifmaxaddr 0 port 197 priority 128 path cost 2000000 member: tap946 flags=3D143 ifmaxaddr 0 port 196 priority 128 path cost 2000000 member: tap945 flags=3D143 ifmaxaddr 0 port 195 priority 128 path cost 2000000 member: tap944 flags=3D143 ifmaxaddr 0 port 194 priority 128 path cost 2000000 member: tap943 flags=3D143 ifmaxaddr 0 port 193 priority 128 path cost 2000000 member: tap942 flags=3D143 ifmaxaddr 0 port 192 priority 128 path cost 2000000 member: tap941 flags=3D143 ifmaxaddr 0 port 191 priority 128 path cost 2000000 member: tap940 flags=3D143 ifmaxaddr 0 port 190 priority 128 path cost 2000000 member: tap939 flags=3D143 ifmaxaddr 0 port 189 priority 128 path cost 2000000 member: tap938 flags=3D143 ifmaxaddr 0 port 188 priority 128 path cost 2000000 member: tap937 flags=3D143 ifmaxaddr 0 port 187 priority 128 path cost 2000000 member: tap936 flags=3D143 ifmaxaddr 0 port 186 priority 128 path cost 2000000 member: tap935 flags=3D143 ifmaxaddr 0 port 185 priority 128 path cost 2000000 member: tap934 flags=3D143 ifmaxaddr 0 port 184 priority 128 path cost 2000000 member: tap933 flags=3D143 ifmaxaddr 0 port 183 priority 128 path cost 2000000 member: tap932 flags=3D143 ifmaxaddr 0 port 182 priority 128 path cost 2000000 member: tap931 flags=3D143 ifmaxaddr 0 port 181 priority 128 path cost 2000000 member: tap930 flags=3D143 ifmaxaddr 0 port 180 priority 128 path cost 2000000 member: tap929 flags=3D143 ifmaxaddr 0 port 179 priority 128 path cost 2000000 member: tap928 flags=3D143 ifmaxaddr 0 port 178 priority 128 path cost 2000000 member: tap927 flags=3D143 ifmaxaddr 0 port 177 priority 128 path cost 2000000 member: tap926 flags=3D143 ifmaxaddr 0 port 176 priority 128 path cost 2000000 member: tap925 flags=3D143 ifmaxaddr 0 port 175 priority 128 path cost 2000000 member: tap924 flags=3D143 ifmaxaddr 0 port 174 priority 128 path cost 2000000 member: tap923 flags=3D143 ifmaxaddr 0 port 173 priority 128 path cost 2000000 member: tap922 flags=3D143 ifmaxaddr 0 port 172 priority 128 path cost 2000000 member: tap921 flags=3D143 ifmaxaddr 0 port 171 priority 128 path cost 2000000 member: tap920 flags=3D143 ifmaxaddr 0 port 170 priority 128 path cost 2000000 member: tap919 flags=3D143 ifmaxaddr 0 port 169 priority 128 path cost 2000000 member: tap918 flags=3D143 ifmaxaddr 0 port 168 priority 128 path cost 2000000 member: tap917 flags=3D143 ifmaxaddr 0 port 167 priority 128 path cost 2000000 member: tap916 flags=3D143 ifmaxaddr 0 port 166 priority 128 path cost 2000000 member: tap915 flags=3D143 ifmaxaddr 0 port 165 priority 128 path cost 2000000 member: tap914 flags=3D143 ifmaxaddr 0 port 164 priority 128 path cost 2000000 member: tap913 flags=3D143 ifmaxaddr 0 port 163 priority 128 path cost 2000000 member: tap912 flags=3D143 ifmaxaddr 0 port 162 priority 128 path cost 2000000 member: tap911 flags=3D143 ifmaxaddr 0 port 161 priority 128 path cost 2000000 member: tap910 flags=3D143 ifmaxaddr 0 port 160 priority 128 path cost 2000000 member: tap909 flags=3D143 ifmaxaddr 0 port 159 priority 128 path cost 2000000 member: tap908 flags=3D143 ifmaxaddr 0 port 158 priority 128 path cost 2000000 member: tap907 flags=3D143 ifmaxaddr 0 port 157 priority 128 path cost 2000000 member: tap906 flags=3D143 ifmaxaddr 0 port 156 priority 128 path cost 2000000 member: tap905 flags=3D143 ifmaxaddr 0 port 155 priority 128 path cost 2000000 member: tap904 flags=3D143 ifmaxaddr 0 port 154 priority 128 path cost 2000000 member: tap903 flags=3D143 ifmaxaddr 0 port 153 priority 128 path cost 2000000 member: tap902 flags=3D143 ifmaxaddr 0 port 152 priority 128 path cost 2000000 member: tap901 flags=3D143 ifmaxaddr 0 port 151 priority 128 path cost 2000000 member: tap900 flags=3D143 ifmaxaddr 0 port 150 priority 128 path cost 2000000 member: tap899 flags=3D143 ifmaxaddr 0 port 149 priority 128 path cost 2000000 groups: bridge nd6 options=3D9 ``` Tested on: * 13.2-RELEASE-p6 * 14.0-RELEASE Notes: * This problem first occurred when I created three hundred of jails using AppJail, which no problems except when trying to stop a jail that uses a Virtualnet (if_bridge(4) + tap(4)). Since it uses the output of ifconfig(8)= to get the members of a bridge and members are missing, AppJail fails to stop a jail. * Please correct me if I am wrong: In reading the relevant source files to understand how to fix this problem, I determined that when the `BRDGGIFS` request is passed to the ioctl(2) system call, it buffers a new ifbreq structure, so that if the returned length stored in ifbac_len plus the size= of ifbreq (meaning a new structure is added) is less than or equal to the accumulated length, we can finish our work. --=20 You are receiving this mail because: You are the assignee for the bug.=