From owner-freebsd-ipfw@FreeBSD.ORG Mon Aug 23 16:57:21 2004 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F215116A4CE; Mon, 23 Aug 2004 16:57:20 +0000 (GMT) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43C9043D46; Mon, 23 Aug 2004 16:57:20 +0000 (GMT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id A1353ACAE6; Mon, 23 Aug 2004 18:57:18 +0200 (CEST) Date: Mon, 23 Aug 2004 18:57:18 +0200 From: Pawel Jakub Dawidek To: Pawel Malachowski Message-ID: <20040823165718.GQ30151@darkness.comp.waw.pl> References: <20040811163426.E06283474C2@shellma.zin.lublin.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7vS62bsm3BVGCDKV" Content-Disposition: inline In-Reply-To: <20040811163426.E06283474C2@shellma.zin.lublin.pl> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 cc: freebsd-ipfw@freebsd.org cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: bin/70311: ipfw(8) pipe/queue show N displays data not only for N X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2004 16:57:21 -0000 --7vS62bsm3BVGCDKV Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 11, 2004 at 06:34:26PM +0200, Pawel Malachowski wrote: +> 2. After patching: +> `ipfw pipe show N' displays data for pipe N and queues with parentpipe= =3DN. +> `ipfw queue show N' displays data for queue N and no pipes. +>=20 +> *** /usr/src/sbin/ipfw/ipfw2.c.orig Wed Aug 11 18:08:27 2004 +> --- /usr/src/sbin/ipfw/ipfw2.c Wed Aug 11 18:27:21 2004 +> *************** +> *** 1498,1504 **** +> next =3D (char *)p + l; +> nbytes -=3D l; +>=20 +> ! if (rulenum !=3D 0 && rulenum !=3D p->pipe_nr) +> continue; +>=20 +> /* +> --- 1498,1504 ---- +> next =3D (char *)p + l; +> nbytes -=3D l; +>=20 +> ! if ( (rulenum !=3D 0 && rulenum !=3D p->pipe_nr) || (do_= pipe=3D=3D2) ) +> continue; +>=20 +> /* +> *************** +> *** 1532,1537 **** +> --- 1532,1542 ---- +> l =3D sizeof(*fs) + fs->rq_elements * sizeof(*q); +> next =3D (char *)fs + l; +> nbytes -=3D l; +> + +> + if (rulenum !=3D 0 && ((rulenum !=3D fs->fs_nr && do_pip= e=3D=3D2) +> + || (rulenum !=3D fs->parent_nr && do_pipe=3D=3D1))) +> + continue; +> + +> q =3D (struct dn_flow_queue *)(fs+1); +> sprintf(prefix, "q%05d: weight %d pipe %d ", +> fs->fs_nr, fs->weight, fs->parent_nr); This patch doesn't work for me as expected. It shows all pipes and queues with parentpipe=3DN. Could you check this patch (it is against -CURRENT, but it should be easy to apply it to 4.x): Index: ipfw2.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /private/FreeBSD/src/sbin/ipfw/ipfw2.c,v retrieving revision 1.54 diff -u -p -r1.54 ipfw2.c --- ipfw2.c 12 Aug 2004 22:06:55 -0000 1.54 +++ ipfw2.c 23 Aug 2004 16:51:26 -0000 @@ -1564,6 +1564,12 @@ list_pipes(void *data, uint nbytes, int=20 l =3D sizeof(*fs) + fs->rq_elements * sizeof(*q); next =3D (char *)fs + l; nbytes -=3D l; + + if (rulenum !=3D 0 && ((rulenum !=3D fs->fs_nr && do_pipe =3D=3D 2) || + (rulenum !=3D fs->parent_nr && do_pipe =3D=3D 1))) { + continue; + } + q =3D (struct dn_flow_queue *)(fs+1); sprintf(prefix, "q%05d: weight %d pipe %d ", fs->fs_nr, fs->weight, fs->parent_nr); Basically, it looks that first addition of 'do_pipe=3D=3D2' is bogus. PS. Could you use unified diff format for patches generation? --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --7vS62bsm3BVGCDKV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFBKiHuForvXbEpPzQRAr79AKChjiIY5ShwiIU+KZO76i1LfXhOOACfTQAm +gD5Y8Oo0SVqDdg5d28LbGk= =mOse -----END PGP SIGNATURE----- --7vS62bsm3BVGCDKV--