From 6afe56f9c3acf521f9896cd2a546ce870d9e3a6c Mon Sep 17 00:00:00 2001 From: Ryan Libby Date: Mon, 25 Nov 2019 22:25:10 +0000 Subject: [PATCH] in6_joingroup_locked: need if_addr_lock around in6m_disconnect_locked It looks like the call that requires the lock was introduced in r337866. Reviewed by: hselasky Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20739 --- sys/netinet6/in6_mcast.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c index 5e7969d2a6da..ec33273144db 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -1267,6 +1267,7 @@ in6_joingroup_locked(struct ifnet *ifp, const struct in6_addr *mcaddr, struct epoch_tracker et; CTR2(KTR_MLD, "%s: dropping ref on %p", __func__, inm); + IF_ADDR_WLOCK(ifp); NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_protospec == inm) { @@ -1277,6 +1278,7 @@ in6_joingroup_locked(struct ifnet *ifp, const struct in6_addr *mcaddr, in6m_disconnect_locked(&inmh, inm); in6m_rele_locked(&inmh, inm); NET_EPOCH_EXIT(et); + IF_ADDR_WUNLOCK(ifp); } else { *pinm = inm; }