Date: Wed, 24 Feb 2016 13:16:03 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295969 - in head: sbin/ipfw sys/netpfil/ipfw Message-ID: <201602241316.u1ODG3oT019169@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602241316.u1ODG3oT019169>