Date: Mon, 20 Apr 2009 22:56:34 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r191341 - head/sys/netinet6 Message-ID: <200904202256.n3KMuYfh060509@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rwatson Date: Mon Apr 20 22:56:34 2009 New Revision: 191341 URL: http://svn.freebsd.org/changeset/base/191341 Log: Assert the interface address list lock in IFP_TO_IA6(), as it will iterate the interface address list. Marginally expand IF_ADDR_LOCK() coverage in mld6.c to make sure it's held when IFP_TO_IA6() is called. MFC after: 2 weeks Modified: head/sys/netinet6/in6_var.h head/sys/netinet6/mld6.c Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Mon Apr 20 22:45:21 2009 (r191340) +++ head/sys/netinet6/in6_var.h Mon Apr 20 22:56:34 2009 (r191341) @@ -503,6 +503,7 @@ MALLOC_DECLARE(M_IP6MADDR); /* struct in6_ifaddr *ia; */ \ do { \ struct ifaddr *ifa; \ + IF_ADDR_LOCK_ASSERT(ifp); \ TAILQ_FOREACH(ifa, &(ifp)->if_addrhead, ifa_link) { \ if (ifa->ifa_addr->sa_family == AF_INET6) \ break; \ Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Mon Apr 20 22:45:21 2009 (r191340) +++ head/sys/netinet6/mld6.c Mon Apr 20 22:56:34 2009 (r191341) @@ -360,9 +360,12 @@ mld6_input(struct mbuf *m, int off) */ timer = ntohs(mldh->mld_maxdelay); + IF_ADDR_LOCK(ifp); IFP_TO_IA6(ifp, ia); - if (ia == NULL) + if (ia == NULL) { + IF_ADDR_UNLOCK(ifp); break; + } /* * XXX: System timer resolution is too low to handle Max @@ -374,7 +377,6 @@ mld6_input(struct mbuf *m, int off) if (timer == 0 && mldh->mld_maxdelay) timer = 1; - IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET6) continue;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904202256.n3KMuYfh060509>