summaryrefslogtreecommitdiff
path: root/sys/netinet6/in6_mcast.c
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2015-12-09 11:14:27 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2015-12-09 11:14:27 +0000
commit9977be4a64ac795fda658d9806415f2a02b11cbb (patch)
treeb51cf84b1ab953667c973fb841c08dd96b18b2c2 /sys/netinet6/in6_mcast.c
parent907809bec0b0099f45bda6dfabdd0c0a197ec528 (diff)
downloadsrc-test2-9977be4a64ac795fda658d9806415f2a02b11cbb.tar.gz
src-test2-9977be4a64ac795fda658d9806415f2a02b11cbb.zip
Notes
Diffstat (limited to 'sys/netinet6/in6_mcast.c')
-rw-r--r--sys/netinet6/in6_mcast.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c
index 131130f8f9de..9d96cf5033d3 100644
--- a/sys/netinet6/in6_mcast.c
+++ b/sys/netinet6/in6_mcast.c
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/in.h>
#include <netinet/in_var.h>
+#include <netinet6/in6_fib.h>
#include <netinet6/in6_var.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
@@ -1772,26 +1773,22 @@ static struct ifnet *
in6p_lookup_mcast_ifp(const struct inpcb *in6p,
const struct sockaddr_in6 *gsin6)
{
- struct route_in6 ro6;
- struct ifnet *ifp;
+ struct nhop6_basic nh6;
+ struct in6_addr dst;
+ uint32_t scopeid;
+ uint32_t fibnum;
KASSERT(in6p->inp_vflag & INP_IPV6,
("%s: not INP_IPV6 inpcb", __func__));
KASSERT(gsin6->sin6_family == AF_INET6,
("%s: not AF_INET6 group", __func__));
- ifp = NULL;
- memset(&ro6, 0, sizeof(struct route_in6));
- memcpy(&ro6.ro_dst, gsin6, sizeof(struct sockaddr_in6));
- rtalloc_ign_fib((struct route *)&ro6, 0,
- in6p ? in6p->inp_inc.inc_fibnum : RT_DEFAULT_FIB);
- if (ro6.ro_rt != NULL) {
- ifp = ro6.ro_rt->rt_ifp;
- KASSERT(ifp != NULL, ("%s: null ifp", __func__));
- RTFREE(ro6.ro_rt);
- }
+ in6_splitscope(&gsin6->sin6_addr, &dst, &scopeid);
+ fibnum = in6p ? in6p->inp_inc.inc_fibnum : RT_DEFAULT_FIB;
+ if (fib6_lookup_nh_basic(fibnum, &dst, scopeid, 0, 0, &nh6) != 0)
+ return (NULL);
- return (ifp);
+ return (nh6.nh_ifp);
}
/*