Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Dec 2011 18:11:54 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r228866 - head/sys/netinet6
Message-ID:  <201112241811.pBOIBsrY023810@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Sat Dec 24 18:11:54 2011
New Revision: 228866
URL: http://svn.freebsd.org/changeset/base/228866

Log:
  Fix a bug where TAILQ_FIRST(&V_ifnet) was accessed without holding the
  proper lock.
  
  Reviewed by:	bz
  MFC after:	1 week

Modified:
  head/sys/netinet6/icmp6.c

Modified: head/sys/netinet6/icmp6.c
==============================================================================
--- head/sys/netinet6/icmp6.c	Sat Dec 24 17:54:58 2011	(r228865)
+++ head/sys/netinet6/icmp6.c	Sat Dec 24 18:11:54 2011	(r228866)
@@ -1851,7 +1851,7 @@ static int
 ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
     struct ifnet *ifp0, int resid)
 {
-	struct ifnet *ifp = ifp0 ? ifp0 : TAILQ_FIRST(&V_ifnet);
+	struct ifnet *ifp;
 	struct in6_ifaddr *ifa6;
 	struct ifaddr *ifa;
 	struct ifnet *ifp_dep = NULL;
@@ -1864,6 +1864,7 @@ ni6_store_addrs(struct icmp6_nodeinfo *n
 		return (0);	/* needless to copy */
 
 	IFNET_RLOCK_NOSLEEP();
+	ifp = ifp0 ? ifp0 : TAILQ_FIRST(&V_ifnet);
   again:
 
 	for (; ifp; ifp = TAILQ_NEXT(ifp, if_list)) {



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