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
This commit is contained in:
parent
127682bc8c
commit
efa13b9da9
@ -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)
|
||||
|
||||
/*
|
||||
|
@ -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)
|
||||
|
||||
/*
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user