diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -345,6 +345,31 @@ return (MCAST_PASS); } +/* + * Look up an in6_multi record for an IPv6 multicast address + * on the interface ifp. + * If no record found, return NULL. + * + * SMPng: The IN6_MULTI_LOCK and must be held and must be in network epoch. + */ +struct in6_multi * +in6m_lookup_locked(struct ifnet *ifp, const struct in6_addr *mcaddr) +{ + struct ifmultiaddr *ifma; + struct in6_multi *inm; + + NET_EPOCH_ASSERT(); + + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) + continue; + if (IN6_ARE_ADDR_EQUAL(&inm->in6m_addr, mcaddr)) + return (inm); + } + return (NULL); +} + /* * Find and return a reference to an in6_multi record for (ifp, group), * and bump its reference count. diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -776,35 +776,13 @@ in6m_ifmultiaddr_get_inm(struct ifmultiaddr *ifma) { - NET_EPOCH_ASSERT(); - return ((ifma->ifma_addr->sa_family != AF_INET6 || (ifma->ifma_flags & IFMA_F_ENQUEUED) == 0) ? NULL : ifma->ifma_protospec); } -/* - * Look up an in6_multi record for an IPv6 multicast address - * on the interface ifp. - * If no record found, return NULL. - * - * SMPng: The IN6_MULTI_LOCK and must be held and must be in network epoch. - */ -static __inline struct in6_multi * -in6m_lookup_locked(struct ifnet *ifp, const struct in6_addr *mcaddr) -{ - struct ifmultiaddr *ifma; - struct in6_multi *inm; - - CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - inm = in6m_ifmultiaddr_get_inm(ifma); - if (inm == NULL) - continue; - if (IN6_ARE_ADDR_EQUAL(&inm->in6m_addr, mcaddr)) - return (inm); - } - return (NULL); -} +struct in6_multi * +in6m_lookup_locked(struct ifnet *ifp, const struct in6_addr *mcaddr); /* * Wrapper for in6m_lookup_locked().