Fix panic introduced by r282070.

Arm friendly KASSERT() to ease debug of similar crashes.

Submitted by:	Olivier Cochard-Labbé
This commit is contained in:
Alexander V. Chernikov 2015-04-28 17:05:55 +00:00
parent 3b7f258a4d
commit e948489558
2 changed files with 4 additions and 1 deletions

View File

@ -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:

View File

@ -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);