summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroleg <oleg@FreeBSD.org>2016-08-18 11:23:02 +0000
committeroleg <oleg@FreeBSD.org>2016-08-18 11:23:02 +0000
commitd27c7793825a2e0a187605c5c736b1b3c2639624 (patch)
treefc32b24c15f3d65251b23e9198eee53aae3688d9
parent62a97a8c671863dcc3390c59e5a6437066464ab8 (diff)
downloadFreeBSD-src-d27c7793825a2e0a187605c5c736b1b3c2639624.zip
FreeBSD-src-d27c7793825a2e0a187605c5c736b1b3c2639624.tar.gz
MFC r304154
Fix command: ipfw set (enable|disable) N (where N > 4).
-rw-r--r--sys/netpfil/ipfw/ip_fw_sockopt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c
index 52dfe7c..43ff56a 100644
--- a/sys/netpfil/ipfw/ip_fw_sockopt.c
+++ b/sys/netpfil/ipfw/ip_fw_sockopt.c
@@ -1414,8 +1414,10 @@ manage_sets(struct ip_fw_chain *chain, ip_fw3_opheader *op3,
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;
OpenPOWER on IntegriCloud