summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordarrenr <darrenr@FreeBSD.org>2005-01-08 04:32:02 +0000
committerdarrenr <darrenr@FreeBSD.org>2005-01-08 04:32:02 +0000
commit41cf7f35b4ac60e93d5b9723174fdf98dca2c32a (patch)
tree2e060ed554c49efa4401d36f09d350692eba6427
parent79b283cecc01f36b072564bc298d880978be180e (diff)
downloadFreeBSD-src-41cf7f35b4ac60e93d5b9723174fdf98dca2c32a.zip
FreeBSD-src-41cf7f35b4ac60e93d5b9723174fdf98dca2c32a.tar.gz
Elminate 1 LOR (actually a recursive mutex grab) involving ipfilter where
we loop through all the list of NICs (struct ifnet), holding the lock on it and then do a name lookup with ifunit() whilst holding it.
-rw-r--r--sys/contrib/ipfilter/netinet/fil.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c
index e545b9b..76fe9d9 100644
--- a/sys/contrib/ipfilter/netinet/fil.c
+++ b/sys/contrib/ipfilter/netinet/fil.c
@@ -2121,31 +2121,8 @@ register frentry_t *fr;
void frsync()
{
-# if !SOLARIS
- register struct ifnet *ifp;
-
-# if defined(__OpenBSD__) || ((NetBSD >= 199511) && (NetBSD < 1991011)) || \
- (defined(__FreeBSD_version) && (__FreeBSD_version >= 300000))
-# if (NetBSD >= 199905) || defined(__OpenBSD__)
- for (ifp = ifnet.tqh_first; ifp; ifp = ifp->if_list.tqe_next)
-# elif defined(__FreeBSD_version) && (__FreeBSD_version >= 500043)
- IFNET_RLOCK();
- TAILQ_FOREACH(ifp, &ifnet, if_link)
-# else
- for (ifp = ifnet.tqh_first; ifp; ifp = ifp->if_link.tqe_next)
-# endif
-# else
- for (ifp = ifnet; ifp; ifp = ifp->if_next)
-# endif
- {
- ip_natsync(ifp);
- ip_statesync(ifp);
- }
- ip_natsync((struct ifnet *)-1);
-# if defined(__FreeBSD_version) && (__FreeBSD_version >= 500043)
- IFNET_RUNLOCK();
-# endif
-# endif /* !SOLARIS */
+ ip_natsync(NULL);
+ ip_statesync(NULL);
WRITE_ENTER(&ipf_mutex);
frsynclist(ipacct[0][fr_active]);
OpenPOWER on IntegriCloud