summaryrefslogtreecommitdiffstats
path: root/sys/netpfil
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2015-04-28 17:05:55 +0000
committermelifaro <melifaro@FreeBSD.org>2015-04-28 17:05:55 +0000
commit55af3aa0e567f927aa75e6bc1bc18a8a27f4f622 (patch)
treedd6cf9cc6d83b126a2b5fb093d23149bede4d8d5 /sys/netpfil
parent8fa8f831450a7751afdd119ea77e37b45b7cfca4 (diff)
downloadFreeBSD-src-55af3aa0e567f927aa75e6bc1bc18a8a27f4f622.zip
FreeBSD-src-55af3aa0e567f927aa75e6bc1bc18a8a27f4f622.tar.gz
Fix panic introduced by r282070.
Arm friendly KASSERT() to ease debug of similar crashes. Submitted by: Olivier Cochard-Labbé
Diffstat (limited to 'sys/netpfil')
-rw-r--r--sys/netpfil/ipfw/ip_fw_sockopt.c1
-rw-r--r--sys/netpfil/ipfw/ip_fw_table.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c
index 94fe09f..d618a6c 100644
--- a/sys/netpfil/ipfw/ip_fw_sockopt.c
+++ b/sys/netpfil/ipfw/ip_fw_sockopt.c
@@ -1647,7 +1647,6 @@ check_ipfw_rule_body(ipfw_insn *cmd, int cmd_len, struct rule_check_info *ci)
return EINVAL;
if (cmdlen != F_INSN_SIZE(ipfw_insn_nat))
goto bad_size;
- ci->object_opcodes++;
goto check_action;
case O_FORWARD_MAC: /* XXX not implemented yet */
case O_CHECK_STATE:
diff --git a/sys/netpfil/ipfw/ip_fw_table.c b/sys/netpfil/ipfw/ip_fw_table.c
index 7858c78..8b15a93 100644
--- a/sys/netpfil/ipfw/ip_fw_table.c
+++ b/sys/netpfil/ipfw/ip_fw_table.c
@@ -3399,6 +3399,10 @@ ref_rule_objects(struct ip_fw_chain *ch, struct ip_fw *rule,
IPFW_UH_WUNLOCK(ch);
+ KASSERT(found + unresolved == ci->object_opcodes,
+ ("refcount incosistency: found: %d unr: %d total: %d",
+ found, unresolved, ci->object_opcodes));
+
/* Perform auto-creation for non-existing objects */
if (numnew != 0)
error = create_objects_compat(ch, rule->cmd, oib, pidx, ti);
OpenPOWER on IntegriCloud