svn commit: r295969 - in head: sbin/ipfw sys/netpfil/ipfw
Andrey V. Elsukov
ae at FreeBSD.org
Wed Feb 24 13:16:05 UTC 2016
Author: ae
Date: Wed Feb 24 13:16:03 2016
New Revision: 295969
URL: https://svnweb.freebsd.org/changeset/base/295969
Log:
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
Modified:
head/sbin/ipfw/ipfw2.c
head/sys/netpfil/ipfw/ip_fw2.c
Modified: head/sbin/ipfw/ipfw2.c
==============================================================================
--- head/sbin/ipfw/ipfw2.c Wed Feb 24 12:37:35 2016 (r295968)
+++ head/sbin/ipfw/ipfw2.c Wed Feb 24 13:16:03 2016 (r295969)
@@ -1029,7 +1029,7 @@ fill_dscp(ipfw_insn *cmd, char *av, int
errx(EX_DATAERR, "Invalid DSCP value");
}
- if (code > 32)
+ if (code >= 32)
*high |= 1 << (code - 32);
else
*low |= 1 << code;
Modified: head/sys/netpfil/ipfw/ip_fw2.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw2.c Wed Feb 24 12:37:35 2016 (r295968)
+++ head/sys/netpfil/ipfw/ip_fw2.c Wed Feb 24 13:16:03 2016 (r295969)
@@ -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);
More information about the svn-src-head
mailing list