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:
parent
96081091e7
commit
fbff7925a1
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user