diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-08-02 23:51:22 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-08-02 23:51:22 +0000 |
commit | efa13b9da9fc80838e2c73140ae27393b3660da4 (patch) | |
tree | 6a51a4d707aa123ea392e553343304e5cac763ac /sys | |
parent | 127682bc8cc0193fbd197a841ceae23e224bfe24 (diff) | |
download | FreeBSD-src-efa13b9da9fc80838e2c73140ae27393b3660da4.zip FreeBSD-src-efa13b9da9fc80838e2c73140ae27393b3660da4.tar.gz |
Modify network protocol consumers of the ifnet multicast address lists
to lock if_addr_mtx.
Problem reported by: Ed Maste <emaste at phaedrus dot sandvine dot ca>
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/in_var.h | 2 | ||||
-rw-r--r-- | sys/netinet6/in6_var.h | 2 | ||||
-rw-r--r-- | sys/netinet6/mld6.c | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index 2106211..95a4558 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 6e2be4f..f9431f8 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 4f62181..35236da 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: |