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)) {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to