Fix 'show' command for pipes and queues. PR: bin/70311 Submitted by: Pawel Malachowski --- ipfw2.c Fri Aug 13 00:06:55 2004 +++ sbin/ipfw/ipfw2.c Mon Aug 23 21:20:27 2004 @@ -17,7 +17,7 @@ * * NEW command line interface for IP firewall facility * - * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.54 2004/08/12 22:06:55 csjp Exp $ + * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.55 2004/08/23 19:20:27 pjd Exp $ */ #include @@ -1530,7 +1530,7 @@ next = (char *)p + l; nbytes -= l; - if (rulenum != 0 && rulenum != p->pipe_nr) + if ((rulenum != 0 && rulenum != p->pipe_nr) || do_pipe == 2) continue; /* @@ -1564,6 +1564,12 @@ 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);