Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_mcast.c
Show First 20 Lines • Show All 1,881 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static struct ifnet * | static struct ifnet * | ||||
inp_lookup_mcast_ifp(const struct inpcb *inp, | inp_lookup_mcast_ifp(const struct inpcb *inp, | ||||
const struct sockaddr_in *gsin, const struct in_addr ina) | const struct sockaddr_in *gsin, const struct in_addr ina) | ||||
{ | { | ||||
struct rm_priotracker in_ifa_tracker; | struct rm_priotracker in_ifa_tracker; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
struct nhop_object *nh; | struct nhop_object *nh; | ||||
uint32_t fibnum; | |||||
KASSERT(inp != NULL, ("%s: inp must not be NULL", __func__)); | |||||
KASSERT(gsin->sin_family == AF_INET, ("%s: not AF_INET", __func__)); | KASSERT(gsin->sin_family == AF_INET, ("%s: not AF_INET", __func__)); | ||||
KASSERT(IN_MULTICAST(ntohl(gsin->sin_addr.s_addr)), | KASSERT(IN_MULTICAST(ntohl(gsin->sin_addr.s_addr)), | ||||
("%s: not multicast", __func__)); | ("%s: not multicast", __func__)); | ||||
ifp = NULL; | ifp = NULL; | ||||
if (!in_nullhost(ina)) { | if (!in_nullhost(ina)) { | ||||
IN_IFADDR_RLOCK(&in_ifa_tracker); | IN_IFADDR_RLOCK(&in_ifa_tracker); | ||||
INADDR_TO_IFP(ina, ifp); | INADDR_TO_IFP(ina, ifp); | ||||
if (ifp != NULL) | if (ifp != NULL) | ||||
if_ref(ifp); | if_ref(ifp); | ||||
IN_IFADDR_RUNLOCK(&in_ifa_tracker); | IN_IFADDR_RUNLOCK(&in_ifa_tracker); | ||||
} else { | } else { | ||||
fibnum = inp ? inp->inp_inc.inc_fibnum : RT_DEFAULT_FIB; | nh = fib4_lookup(inp->inp_inc.inc_fibnum, gsin->sin_addr, 0, NHR_NONE, 0); | ||||
nh = fib4_lookup(fibnum, gsin->sin_addr, 0, NHR_NONE, 0); | |||||
if (nh != NULL) { | if (nh != NULL) { | ||||
ifp = nh->nh_ifp; | ifp = nh->nh_ifp; | ||||
if_ref(ifp); | if_ref(ifp); | ||||
} else { | } else { | ||||
struct in_ifaddr *ia; | struct in_ifaddr *ia; | ||||
struct ifnet *mifp; | struct ifnet *mifp; | ||||
mifp = NULL; | mifp = NULL; | ||||
▲ Show 20 Lines • Show All 1,145 Lines • Show Last 20 Lines |