Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Oct 2012 19:22:32 +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: r241908 - head/sys/netpfil/ipfw
Message-ID:  <201210221922.q9MJMWBl085463@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: melifaro
Date: Mon Oct 22 19:22:31 2012
New Revision: 241908
URL: http://svn.freebsd.org/changeset/base/241908

Log:
  Remove unnecessary chain read lock in ipfw nat 'global' code.
  Document case when ipfw chain lock must be held while calling ipfw_nat().
  
  MFC after:	2 weeks

Modified:
  head/sys/netpfil/ipfw/ip_fw_nat.c

Modified: head/sys/netpfil/ipfw/ip_fw_nat.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw_nat.c	Mon Oct 22 19:06:00 2012	(r241907)
+++ head/sys/netpfil/ipfw/ip_fw_nat.c	Mon Oct 22 19:22:31 2012	(r241908)
@@ -202,6 +202,13 @@ add_redir_spool_cfg(char *buf, struct cf
 	}
 }
 
+/*
+ * ipfw_nat - perform mbuf header translation.
+ *
+ * Note V_layer3_chain has to be locked while calling ipfw_nat() in
+ * 'global' operation mode (t == NULL).
+ *
+ */
 static int
 ipfw_nat(struct ip_fw_args *args, struct cfg_nat *t, struct mbuf *m)
 {
@@ -269,7 +276,6 @@ ipfw_nat(struct ip_fw_args *args, struct
 
 		found = 0;
 		chain = &V_layer3_chain;
-		IPFW_RLOCK(chain);
 		/* Check every nat entry... */
 		LIST_FOREACH(t, &chain->nat, _next) {
 			if ((t->mode & PKT_ALIAS_SKIP_GLOBAL) != 0)
@@ -282,7 +288,6 @@ ipfw_nat(struct ip_fw_args *args, struct
 				break;
 			}
 		}
-		IPFW_RUNLOCK(chain);
 		if (found != 1) {
 			/* No instance found, return ignore */
 			args->m = mcl;



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