Author: melifaro
Date: Tue Apr 28 17:05:55 2015
New Revision: 282155
URL: https://svnweb.freebsd.org/changeset/base/282155

Log:
  Fix panic introduced by r282070.
  Arm friendly KASSERT() to ease debug of similar crashes.
  
  Submitted by: Olivier Cochard-Labbé

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

Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw_sockopt.c       Tue Apr 28 17:02:43 2015        
(r282154)
+++ head/sys/netpfil/ipfw/ip_fw_sockopt.c       Tue Apr 28 17:05:55 2015        
(r282155)
@@ -1647,7 +1647,6 @@ check_ipfw_rule_body(ipfw_insn *cmd, int
                                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:

Modified: head/sys/netpfil/ipfw/ip_fw_table.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw_table.c Tue Apr 28 17:02:43 2015        
(r282154)
+++ head/sys/netpfil/ipfw/ip_fw_table.c Tue Apr 28 17:05:55 2015        
(r282155)
@@ -3399,6 +3399,10 @@ ref_rule_objects(struct ip_fw_chain *ch,
 
        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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to