summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl_altq.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-04-12 16:39:02 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-04-12 16:39:02 +0000
commitc094265087a44214d0349669a2ae2b8a9f5c5d6c (patch)
tree9e77a26848446fc492f8e1a5d15a3580485b145a /sbin/pfctl/pfctl_altq.c
parentbc9e71f5abe5a0c68deec657115e5fc69a2a7c5b (diff)
fix print_hfsc_opts to only print "hfsc( " and " )" when there are opts to
print, so it behaves like the print_*_opts for the other schedulers
Diffstat (limited to 'sbin/pfctl/pfctl_altq.c')
-rw-r--r--sbin/pfctl/pfctl_altq.c80
1 files changed, 43 insertions, 37 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
index 07da77cf7b1..593c84998e7 100644
--- a/sbin/pfctl/pfctl_altq.c
+++ b/sbin/pfctl/pfctl_altq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_altq.c,v 1.53 2003/04/12 15:09:57 henning Exp $ */
+/* $OpenBSD: pfctl_altq.c,v 1.54 2003/04/12 16:39:01 henning Exp $ */
/*
* Copyright (C) 2002
@@ -818,45 +818,51 @@ print_hfsc_opts(const struct pf_altq *a)
opts = &a->pq_u.hfsc_opts;
- printf("hfsc(");
- if (opts->flags & HFCF_RED)
- printf(" red");
- if (opts->flags & HFCF_ECN)
- printf(" ecn");
- if (opts->flags & HFCF_RIO)
- printf(" rio");
- if (opts->flags & HFCF_CLEARDSCP)
- printf(" cleardscp");
- if (opts->flags & HFCF_DEFAULTCLASS)
- printf(" default");
- if (opts->rtsc_m2 != 0) {
- if (opts->rtsc_d != 0)
- printf(" realtime(%s %ums %s)",
- rate2str((double)opts->rtsc_m1), opts->rtsc_d,
- rate2str((double)opts->rtsc_m2));
- else
- printf(" realtime %s",
- rate2str((double)opts->rtsc_m2));
- }
- if (opts->lssc_m2 != 0) {
- if (opts->lssc_d != 0)
- printf(" linkshare(%s %ums %s)",
- rate2str((double)opts->lssc_m1), opts->lssc_d,
- rate2str((double)opts->lssc_m2));
- else
- printf(" linkshare %s",
- rate2str((double)opts->lssc_m2));
- }
- if (opts->ulsc_m2 != 0) {
- if (opts->ulsc_d != 0)
- printf(" upperlimit(%s %ums %s)",
- rate2str((double)opts->ulsc_m1), opts->ulsc_d,
- rate2str((double)opts->ulsc_m2));
+ if (opts->flags || opts->rtsc_m2 != 0 || opts->lssc_m2 != 0 ||
+ opts->ulsc_m2 != 0) {
+ printf("hfsc(");
+ if (opts->flags & HFCF_RED)
+ printf(" red");
+ if (opts->flags & HFCF_ECN)
+ printf(" ecn");
+ if (opts->flags & HFCF_RIO)
+ printf(" rio");
+ if (opts->flags & HFCF_CLEARDSCP)
+ printf(" cleardscp");
+ if (opts->flags & HFCF_DEFAULTCLASS)
+ printf(" default");
+ if (opts->rtsc_m2 != 0) {
+ if (opts->rtsc_d != 0)
+ printf(" realtime(%s %ums %s)",
+ rate2str((double)opts->rtsc_m1),
+ opts->rtsc_d,
+ rate2str((double)opts->rtsc_m2));
+ else
+ printf(" realtime %s",
+ rate2str((double)opts->rtsc_m2));
+ }
+ if (opts->lssc_m2 != 0) {
+ if (opts->lssc_d != 0)
+ printf(" linkshare(%s %ums %s)",
+ rate2str((double)opts->lssc_m1),
+ opts->lssc_d,
+ rate2str((double)opts->lssc_m2));
else
- printf(" upperlimit(%s)",
+ printf(" linkshare %s",
+ rate2str((double)opts->lssc_m2));
+ }
+ if (opts->ulsc_m2 != 0) {
+ if (opts->ulsc_d != 0)
+ printf(" upperlimit(%s %ums %s)",
+ rate2str((double)opts->ulsc_m1),
+ opts->ulsc_d,
rate2str((double)opts->ulsc_m2));
+ else
+ printf(" upperlimit(%s)",
+ rate2str((double)opts->ulsc_m2));
+ }
+ printf(" ) ");
}
- printf(" ) ");
}
/*