diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index 21062115196f..95a4558ef3eb 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -185,6 +185,7 @@ struct in_multistep { do { \ struct ifmultiaddr *ifma; \ \ + IF_ADDR_LOCK(ifp); \ TAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) { \ if (ifma->ifma_addr->sa_family == AF_INET \ && ((struct sockaddr_in *)ifma->ifma_addr)->sin_addr.s_addr == \ @@ -192,6 +193,7 @@ do { \ break; \ } \ (inm) = ifma ? ifma->ifma_protospec : 0; \ + IF_ADDR_UNLOCK(ifp); \ } while(0) /* diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index 6e2be4f5d849..f9431f8e77f2 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -543,6 +543,7 @@ struct in6_multistep { /* struct in6_multi *in6m; */ \ do { \ struct ifmultiaddr *ifma; \ + IF_ADDR_LOCK(ifp); \ TAILQ_FOREACH(ifma, &(ifp)->if_multiaddrs, ifma_link) { \ if (ifma->ifma_addr->sa_family == AF_INET6 \ && IN6_ARE_ADDR_EQUAL(&((struct sockaddr_in6 *)ifma->ifma_addr)->sin6_addr, \ @@ -550,6 +551,7 @@ do { \ break; \ } \ (in6m) = (struct in6_multi *)(ifma ? ifma->ifma_protospec : 0); \ + IF_ADDR_UNLOCK(ifp); \ } while(0) /* diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 4f621816a369..35236da2acd5 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -290,6 +290,7 @@ mld6_input(m, 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; @@ -317,6 +318,7 @@ mld6_input(m, off) } } } + IF_ADDR_UNLOCK(ifp); break; case MLD_LISTENER_REPORT: