From f5dde2a92fbb7bb043f9f3d816b168ddcaf19b6c Mon Sep 17 00:00:00 2001 From: kp Date: Tue, 2 Aug 2016 15:41:42 +0000 Subject: [PATCH] pfctl: Allow TOS bits to be cleared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sbin/pfctl/parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index c7727d8a3a3..9f22b7391ee 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -3607,7 +3607,7 @@ tos : STRING { } | NUMBER { $$ = $1; - if (!$$ || $$ > 255) { + if ($$ < 0 || $$ > 255) { yyerror("illegal tos value %s", $1); YYERROR; }