bin/70311: ipfw(8) pipe/queue show N displays data not only for
N
Pawel Jakub Dawidek
pjd at FreeBSD.org
Mon Aug 23 09:57:21 PDT 2004
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=N.
+> `ipfw queue show N' displays data for queue N and no pipes.
+>
+> *** /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 = (char *)p + l;
+> nbytes -= l;
+>
+> ! if (rulenum != 0 && rulenum != p->pipe_nr)
+> continue;
+>
+> /*
+> --- 1498,1504 ----
+> next = (char *)p + l;
+> nbytes -= l;
+>
+> ! if ( (rulenum != 0 && rulenum != p->pipe_nr) || (do_pipe==2) )
+> continue;
+>
+> /*
+> ***************
+> *** 1532,1537 ****
+> --- 1532,1542 ----
+> l = sizeof(*fs) + fs->rq_elements * sizeof(*q);
+> next = (char *)fs + l;
+> nbytes -= l;
+> +
+> + if (rulenum != 0 && ((rulenum != fs->fs_nr && do_pipe==2)
+> + || (rulenum != fs->parent_nr && do_pipe==1)))
+> + continue;
+> +
+> q = (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=N.
Could you check this patch (it is against -CURRENT, but it should be easy
to apply it to 4.x):
Index: ipfw2.c
===================================================================
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
l = sizeof(*fs) + fs->rq_elements * sizeof(*q);
next = (char *)fs + l;
nbytes -= l;
+
+ if (rulenum != 0 && ((rulenum != fs->fs_nr && do_pipe == 2) ||
+ (rulenum != fs->parent_nr && do_pipe == 1))) {
+ continue;
+ }
+
q = (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==2' is bogus.
PS. Could you use unified diff format for patches generation?
--
Pawel Jakub Dawidek http://www.FreeBSD.org
pjd at FreeBSD.org http://garage.freebsd.pl
FreeBSD committer Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ipfw/attachments/20040823/d1299eb9/attachment.bin
More information about the freebsd-ipfw
mailing list