Fix bug in filling and handling ipfw's O_DSCP opcode.

Due to integer overflow CS4 token was handled as BE.

PR:		207459
MFC after:	1 week
This commit is contained in:
ae 2016-02-24 13:16:03 +00:00
parent 96081091e7
commit fbff7925a1
2 changed files with 2 additions and 2 deletions

View File

@ -1029,7 +1029,7 @@ fill_dscp(ipfw_insn *cmd, char *av, int cblen)
errx(EX_DATAERR, "Invalid DSCP value");
}
if (code > 32)
if (code >= 32)
*high |= 1 << (code - 32);
else
*low |= 1 << code;

View File

@ -1711,7 +1711,7 @@ do { \
break;
/* DSCP bitmask is stored as low_u32 high_u32 */
if (x > 32)
if (x >= 32)
match = *(p + 1) & (1 << (x - 32));
else
match = *p & (1 << x);