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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to