pfctl: Allow TOS bits to be cleared

TOS value 0 is valid, so use 256 as an invalid value rather than zero.
This allows users to enforce TOS == 0 with pf.

Reported by:	Radek Krejča <radek.krejca@starnet.cz>
This commit is contained in:
kp 2016-08-02 15:41:42 +00:00 committed by Franco Fichtner
parent fa04428122
commit f5dde2a92f

View file

@ -3607,7 +3607,7 @@ tos : STRING {
}
| NUMBER {
$$ = $1;
if (!$$ || $$ > 255) {
if ($$ < 0 || $$ > 255) {
yyerror("illegal tos value %s", $1);
YYERROR;
}