Fix a bug where TAILQ_FIRST(&V_ifnet) was accessed without holding the
proper lock. Reviewed by: bz MFC after: 1 week
This commit is contained in:
parent
6512fa7aec
commit
94e8313349
@ -1851,7 +1851,7 @@ static int
|
|||||||
ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
|
ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
|
||||||
struct ifnet *ifp0, int resid)
|
struct ifnet *ifp0, int resid)
|
||||||
{
|
{
|
||||||
struct ifnet *ifp = ifp0 ? ifp0 : TAILQ_FIRST(&V_ifnet);
|
struct ifnet *ifp;
|
||||||
struct in6_ifaddr *ifa6;
|
struct in6_ifaddr *ifa6;
|
||||||
struct ifaddr *ifa;
|
struct ifaddr *ifa;
|
||||||
struct ifnet *ifp_dep = NULL;
|
struct ifnet *ifp_dep = NULL;
|
||||||
@ -1864,6 +1864,7 @@ ni6_store_addrs(struct icmp6_nodeinfo *ni6, struct icmp6_nodeinfo *nni6,
|
|||||||
return (0); /* needless to copy */
|
return (0); /* needless to copy */
|
||||||
|
|
||||||
IFNET_RLOCK_NOSLEEP();
|
IFNET_RLOCK_NOSLEEP();
|
||||||
|
ifp = ifp0 ? ifp0 : TAILQ_FIRST(&V_ifnet);
|
||||||
again:
|
again:
|
||||||
|
|
||||||
for (; ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
|
for (; ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user