Lines Matching refs:src_rt
10379 struct route src_rt; in ifnet_cached_rtlookup_inet() local
10382 dst = (struct sockaddr_in *)(void *)(&src_rt.ro_dst); in ifnet_cached_rtlookup_inet()
10384 ifp_src_route_copyout(ifp, &src_rt); in ifnet_cached_rtlookup_inet()
10386 if (ROUTE_UNUSABLE(&src_rt) || src_ip.s_addr != dst->sin_addr.s_addr) { in ifnet_cached_rtlookup_inet()
10387 ROUTE_RELEASE(&src_rt); in ifnet_cached_rtlookup_inet()
10389 bzero(&src_rt.ro_dst, sizeof(src_rt.ro_dst)); in ifnet_cached_rtlookup_inet()
10390 dst->sin_len = sizeof(src_rt.ro_dst); in ifnet_cached_rtlookup_inet()
10395 VERIFY(src_rt.ro_rt == NULL); in ifnet_cached_rtlookup_inet()
10396 src_rt.ro_rt = rtalloc1_scoped((struct sockaddr *)dst, in ifnet_cached_rtlookup_inet()
10399 if (src_rt.ro_rt != NULL) { in ifnet_cached_rtlookup_inet()
10401 struct rtentry *rte = src_rt.ro_rt; in ifnet_cached_rtlookup_inet()
10403 ifp_src_route_copyin(ifp, &src_rt); in ifnet_cached_rtlookup_inet()
10404 src_rt.ro_rt = rte; in ifnet_cached_rtlookup_inet()
10408 return src_rt.ro_rt; in ifnet_cached_rtlookup_inet()
10414 struct route_in6 src_rt; in ifnet_cached_rtlookup_inet6() local
10416 ifp_src_route6_copyout(ifp, &src_rt); in ifnet_cached_rtlookup_inet6()
10418 if (ROUTE_UNUSABLE(&src_rt) || in ifnet_cached_rtlookup_inet6()
10419 !IN6_ARE_ADDR_EQUAL(src_ip6, &src_rt.ro_dst.sin6_addr)) { in ifnet_cached_rtlookup_inet6()
10420 ROUTE_RELEASE(&src_rt); in ifnet_cached_rtlookup_inet6()
10421 if (src_rt.ro_dst.sin6_family != AF_INET6) { in ifnet_cached_rtlookup_inet6()
10422 bzero(&src_rt.ro_dst, sizeof(src_rt.ro_dst)); in ifnet_cached_rtlookup_inet6()
10423 src_rt.ro_dst.sin6_len = sizeof(src_rt.ro_dst); in ifnet_cached_rtlookup_inet6()
10424 src_rt.ro_dst.sin6_family = AF_INET6; in ifnet_cached_rtlookup_inet6()
10426 src_rt.ro_dst.sin6_scope_id = in6_addr2scopeid(ifp, src_ip6); in ifnet_cached_rtlookup_inet6()
10427 bcopy(src_ip6, &src_rt.ro_dst.sin6_addr, in ifnet_cached_rtlookup_inet6()
10428 sizeof(src_rt.ro_dst.sin6_addr)); in ifnet_cached_rtlookup_inet6()
10430 if (src_rt.ro_rt == NULL) { in ifnet_cached_rtlookup_inet6()
10431 src_rt.ro_rt = rtalloc1_scoped( in ifnet_cached_rtlookup_inet6()
10432 (struct sockaddr *)&src_rt.ro_dst, 0, 0, in ifnet_cached_rtlookup_inet6()
10435 if (src_rt.ro_rt != NULL) { in ifnet_cached_rtlookup_inet6()
10437 struct rtentry *rte = src_rt.ro_rt; in ifnet_cached_rtlookup_inet6()
10439 ifp_src_route6_copyin(ifp, &src_rt); in ifnet_cached_rtlookup_inet6()
10440 src_rt.ro_rt = rte; in ifnet_cached_rtlookup_inet6()
10445 return src_rt.ro_rt; in ifnet_cached_rtlookup_inet6()