diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-04-13 23:39:19 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-04-13 23:39:19 +0000 |
commit | 0d9cf8a89977431fb373990d4f42f735c4e0806c (patch) | |
tree | f4ad1e32bd8d314aef6e6a00af3cbb99b387b89d /sbin | |
parent | 04127575525afe8761505a2f1affda6c05ca5f79 (diff) |
prevent double service curve specification
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/parse.y | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 8b16b7cd684..4015279deee 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.363 2003/04/13 23:34:31 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.364 2003/04/13 23:39:18 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -1068,20 +1068,36 @@ hfscopts_item : LINKSHARE bandwidth { hfsc_opts.linkshare.used = 1; } | REALTIME bandwidth { + if (hfsc_opts.realtime.used) { + yyerror("realtime already specified"); + YYERROR; + } hfsc_opts.realtime.m2 = $2; hfsc_opts.realtime.used = 1; } | REALTIME '(' bandwidth number bandwidth ')' { + if (hfsc_opts.realtime.used) { + yyerror("realtime already specified"); + YYERROR; + } hfsc_opts.realtime.m1 = $3; hfsc_opts.realtime.d = $4; hfsc_opts.realtime.m2 = $5; hfsc_opts.realtime.used = 1; } | UPPERLIMIT bandwidth { + if (hfsc_opts.upperlimit.used) { + yyerror("upperlimit already specified"); + YYERROR; + } hfsc_opts.upperlimit.m2 = $2; hfsc_opts.upperlimit.used = 1; } | UPPERLIMIT '(' bandwidth number bandwidth ')' { + if (hfsc_opts.upperlimit.used) { + yyerror("upperlimit already specified"); + YYERROR; + } hfsc_opts.upperlimit.m1 = $3; hfsc_opts.upperlimit.d = $4; hfsc_opts.upperlimit.m2 = $5; |