summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-05-23 17:22:53 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-05-23 17:40:19 +0200
commit6aaaa63519c88c872f15dcc639643103b563b1c6 (patch)
treecbb3164de6d0b746727b54aec212168b8467f379 /nest
parent0705a1c5658c2682c915007f466f55d2a8f7ec14 (diff)
Change parser to handle numbers as unsigned
Lexer always parsed numbers as unsigned, but parser handled them as signed and grammar contained many unnecessary checks for negativity.
Diffstat (limited to 'nest')
-rw-r--r--nest/config.Y4
1 files changed, 2 insertions, 2 deletions
diff --git a/nest/config.Y b/nest/config.Y
index e672d730..220fa8b0 100644
--- a/nest/config.Y
+++ b/nest/config.Y
@@ -349,8 +349,8 @@ iface_patt:
;
tos:
- CLASS expr { $$ = $2 & 0xfc; if (($2 < 0) || ($2 > 255)) cf_error("TX class must be in range 0-255"); }
- | DSCP expr { $$ = ($2 & 0x3f) << 2; if (($2 < 0) || ($2 > 63)) cf_error("TX DSCP must be in range 0-63"); }
+ CLASS expr { $$ = $2 & 0xfc; if ($2 > 255) cf_error("TX class must be in range 0-255"); }
+ | DSCP expr { $$ = ($2 & 0x3f) << 2; if ($2 > 63) cf_error("TX DSCP must be in range 0-63"); }
;
/* Direct device route protocol */