Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Aug 2016 13:06:30 +0000 (UTC)
From:      Oleg Bulyzhin <oleg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304154 - head/sys/netpfil/ipfw
Message-ID:  <201608151306.u7FD6UUQ052654@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: oleg
Date: Mon Aug 15 13:06:29 2016
New Revision: 304154
URL: https://svnweb.freebsd.org/changeset/base/304154

Log:
  Fix command: ipfw set (enable|disable) N (where N > 4).
  enable_sets() expects set bitmasks, not set numbers.
  
  MFC after:	3 days

Modified:
  head/sys/netpfil/ipfw/ip_fw_sockopt.c

Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw_sockopt.c	Mon Aug 15 12:56:45 2016	(r304153)
+++ head/sys/netpfil/ipfw/ip_fw_sockopt.c	Mon Aug 15 13:06:29 2016	(r304154)
@@ -1420,8 +1420,10 @@ manage_sets(struct ip_fw_chain *chain, i
 
 	if (rh->range.head.length != sizeof(ipfw_range_tlv))
 		return (1);
-	if (rh->range.set >= IPFW_MAX_SETS ||
-	    rh->range.new_set >= IPFW_MAX_SETS)
+	/* enable_sets() expects bitmasks. */
+	if (op3->opcode != IP_FW_SET_ENABLE &&
+	    (rh->range.set >= IPFW_MAX_SETS ||
+	    rh->range.new_set >= IPFW_MAX_SETS))
 		return (EINVAL);
 
 	ret = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608151306.u7FD6UUQ052654>