summaryrefslogtreecommitdiffstats
path: root/sys/netpfil
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2017-03-10 05:44:14 +0000
committerae <ae@FreeBSD.org>2017-03-10 05:44:14 +0000
commit2a62e338590335911213425c6312fb6680dc4f08 (patch)
treea496aba687b5c9bdc9246500590d99d58ee53cf3 /sys/netpfil
parent73d3c48966c53bf149f10b36da33ed60c60243c1 (diff)
downloadFreeBSD-src-2a62e338590335911213425c6312fb6680dc4f08.zip
FreeBSD-src-2a62e338590335911213425c6312fb6680dc4f08.tar.gz
MFC r314614:
Fix matching table entry value. Use real table value instead of its index in valuestate array. When opcode has size equal to ipfw_insn_u32, this means that it should additionally match value specified in d[0] with table entry value. ipfw_table_lookup() returns table value index, use TARG_VAL() macro to convert it to its value. The actual 32-bit value stored in the tag field of table_value structure, where all unspecified u32 values are kept. PR: 217262
Diffstat (limited to 'sys/netpfil')
-rw-r--r--sys/netpfil/ipfw/ip_fw2.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c
index a80d1e5..d96b14c 100644
--- a/sys/netpfil/ipfw/ip_fw2.c
+++ b/sys/netpfil/ipfw/ip_fw2.c
@@ -1510,8 +1510,8 @@ do { \
if (!match)
break;
if (cmdlen == F_INSN_SIZE(ipfw_insn_u32))
- match =
- ((ipfw_insn_u32 *)cmd)->d[0] == v;
+ match = ((ipfw_insn_u32 *)cmd)->d[0] ==
+ TARG_VAL(chain, v, tag);
else
tablearg = v;
} else if (is_ipv6) {
@@ -1523,7 +1523,8 @@ do { \
sizeof(struct in6_addr),
pkey, &v);
if (cmdlen == F_INSN_SIZE(ipfw_insn_u32))
- match = ((ipfw_insn_u32 *)cmd)->d[0] == v;
+ match = ((ipfw_insn_u32 *)cmd)->d[0] ==
+ TARG_VAL(chain, v, tag);
if (match)
tablearg = v;
}
@@ -1535,7 +1536,8 @@ do { \
match = ipfw_lookup_table_extended(chain,
cmd->arg1, 0, &args->f_id, &v);
if (cmdlen == F_INSN_SIZE(ipfw_insn_u32))
- match = ((ipfw_insn_u32 *)cmd)->d[0] == v;
+ match = ((ipfw_insn_u32 *)cmd)->d[0] ==
+ TARG_VAL(chain, v, tag);
if (match)
tablearg = v;
}
OpenPOWER on IntegriCloud