From 41cf7f35b4ac60e93d5b9723174fdf98dca2c32a Mon Sep 17 00:00:00 2001 From: darrenr Date: Sat, 8 Jan 2005 04:32:02 +0000 Subject: 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. --- sys/contrib/ipfilter/netinet/fil.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'sys') 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]); -- cgit v1.1