diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2002-11-27 16:23:02 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2002-11-27 16:23:02 +0000 |
commit | 771b3db296fb935b2ca4a73dc850981018e7f529 (patch) | |
tree | d27e17ea1ec359b8c7ac1b05e3af0ceba2014217 /sbin | |
parent | 0510fdf81d03191735c5e0143530dc90cb494e07 (diff) |
-use a #define for default qlimit instead of hardcoding it
-print qlimit in print_queue if it is not the default one
-assign the default qlimit early in the parser instead of using 0
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/parse.y | 4 | ||||
-rw-r--r-- | sbin/pfctl/pfctl_altq.c | 6 | ||||
-rw-r--r-- | sbin/pfctl/pfctl_altq.h | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 1e82be489e0..c48025feed8 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.221 2002/11/27 16:06:20 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.222 2002/11/27 16:23:01 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -670,7 +670,7 @@ priority : /* empty */ { $$ = DEFAULT_PRIORITY; } } ; -qlimit : /* empty */ { $$ = 0; } +qlimit : /* empty */ { $$ = DEFAULT_QLIMIT; } | QLIMIT number { if ($2 > 65535) { yyerror("qlimit out of range: max 65535"); diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c index a826c350a1c..4c31aeeb7ba 100644 --- a/sbin/pfctl/pfctl_altq.c +++ b/sbin/pfctl/pfctl_altq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_altq.c,v 1.11 2002/11/27 16:06:20 henning Exp $ */ +/* $OpenBSD: pfctl_altq.c,v 1.12 2002/11/27 16:23:01 henning Exp $ */ /* * Copyright (C) 2002 * Sony Computer Science Laboratories Inc. All rights reserved. @@ -167,6 +167,8 @@ print_queue(const struct pf_altq *a, unsigned level) printf("bandwidth %s ", rate2str((double)a->bandwidth)); if (a->priority != DEFAULT_PRIORITY) printf("priority %u ", a->priority); + if (a->qlimit != DEFAULT_QLIMIT) + printf("qlimit %u ", a->qlimit); switch (a->scheduler) { case ALTQT_CBQ: print_cbq_opts(a); @@ -240,7 +242,7 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, u_int32_t bw_absolute, pa->parent_qid = parent->qid; } if (pa->qlimit == 0) - pa->qlimit = 50; + pa->qlimit = DEFAULT_QLIMIT; if (bw_absolute > 0) pa->bandwidth = bw_absolute; diff --git a/sbin/pfctl/pfctl_altq.h b/sbin/pfctl/pfctl_altq.h index 60243023997..c1b2aed579d 100644 --- a/sbin/pfctl/pfctl_altq.h +++ b/sbin/pfctl/pfctl_altq.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_altq.h,v 1.2 2002/11/27 15:49:17 henning Exp $ */ +/* $OpenBSD: pfctl_altq.h,v 1.3 2002/11/27 16:23:01 henning Exp $ */ /* * Copyright (C) 2002 * Sony Computer Science Laboratories Inc. All rights reserved. @@ -77,6 +77,7 @@ #ifndef DEFAULT_PRIORITY #define DEFAULT_PRIORITY 1 +#define DEFAULT_QLIMIT 50 #endif struct pf_altq_node { |