svn commit: r203614 - user/luigi/ipfw3-head/sys/netinet/ipfw

Luigi Rizzo luigi at FreeBSD.org
Sun Feb 7 17:50:14 UTC 2010


Author: luigi
Date: Sun Feb  7 17:50:13 2010
New Revision: 203614
URL: http://svn.freebsd.org/changeset/base/203614

Log:
  fix a panic on lock recursion when doing "ipfw set XXX ...".
  I moved the lock/unlock around the entire switch and forgot
  to remove the calls internally.
  
  Submitted by:	Marta Carbone

Modified:
  user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_sockopt.c

Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_sockopt.c
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_sockopt.c	Sun Feb  7 17:05:22 2010	(r203613)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_sockopt.c	Sun Feb  7 17:50:13 2010	(r203614)
@@ -343,27 +343,22 @@ del_entry(struct ip_fw_chain *chain, u_i
 		break;
 
 	case 2:	/* move rules with given number to new set */
-		IPFW_UH_WLOCK(chain);
 		for (i = 0; i < chain->n_rules; i++) {
 			rule = chain->map[i];
 			if (rule->rulenum == rulenum)
 				rule->set = new_set;
 		}
-		IPFW_UH_WUNLOCK(chain);
 		break;
 
 	case 3: /* move rules with given set number to new set */
-		IPFW_UH_WLOCK(chain);
 		for (i = 0; i < chain->n_rules; i++) {
 			rule = chain->map[i];
 			if (rule->set == rulenum)
 				rule->set = new_set;
 		}
-		IPFW_UH_WUNLOCK(chain);
 		break;
 
 	case 4: /* swap two sets */
-		IPFW_UH_WLOCK(chain);
 		for (i = 0; i < chain->n_rules; i++) {
 			rule = chain->map[i];
 			if (rule->set == rulenum)
@@ -371,7 +366,6 @@ del_entry(struct ip_fw_chain *chain, u_i
 			else if (rule->set == new_set)
 				rule->set = rulenum;
 		}
-		IPFW_UH_WUNLOCK(chain);
 		break;
 	}
 	rule = chain->reap;


More information about the svn-src-user mailing list