Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 2015 17:05:56 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r282155 - head/sys/netpfil/ipfw
Message-ID:  <201504281705.t3SH5u8B092228@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504281705.t3SH5u8B092228>