Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet6/in6_fib.c
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | fib6_rte_to_nh_basic(struct rtentry *rte, const struct in6_addr *dst, | ||||
if ((flags & NHR_IFAIF) != 0) | if ((flags & NHR_IFAIF) != 0) | ||||
pnh6->nh_ifp = fib6_get_ifaifp(rte); | pnh6->nh_ifp = fib6_get_ifaifp(rte); | ||||
else | else | ||||
pnh6->nh_ifp = rte->rt_ifp; | pnh6->nh_ifp = rte->rt_ifp; | ||||
pnh6->nh_mtu = min(rte->rt_mtu, IN6_LINKMTU(rte->rt_ifp)); | pnh6->nh_mtu = min(rte->rt_mtu, IN6_LINKMTU(rte->rt_ifp)); | ||||
if (rte->rt_flags & RTF_GATEWAY) { | if (rte->rt_flags & RTF_GATEWAY) { | ||||
/* Return address with embedded scope. */ | |||||
gw = (struct sockaddr_in6 *)rte->rt_gateway; | gw = (struct sockaddr_in6 *)rte->rt_gateway; | ||||
pnh6->nh_addr = gw->sin6_addr; | pnh6->nh_addr = gw->sin6_addr; | ||||
in6_clearscope(&pnh6->nh_addr); | |||||
} else | } else | ||||
pnh6->nh_addr = *dst; | pnh6->nh_addr = *dst; | ||||
/* Set flags */ | /* Set flags */ | ||||
pnh6->nh_flags = fib_rte_to_nh_flags(rte->rt_flags); | pnh6->nh_flags = fib_rte_to_nh_flags(rte->rt_flags); | ||||
gw = (struct sockaddr_in6 *)rt_key(rte); | gw = (struct sockaddr_in6 *)rt_key(rte); | ||||
if (IN6_IS_ADDR_UNSPECIFIED(&gw->sin6_addr)) | if (IN6_IS_ADDR_UNSPECIFIED(&gw->sin6_addr)) | ||||
pnh6->nh_flags |= NHF_DEFAULT; | pnh6->nh_flags |= NHF_DEFAULT; | ||||
} | } | ||||
Show All 9 Lines | fib6_rte_to_nh_extended(struct rtentry *rte, const struct in6_addr *dst, | ||||
if ((flags & NHR_IFAIF) != 0) | if ((flags & NHR_IFAIF) != 0) | ||||
pnh6->nh_ifp = fib6_get_ifaifp(rte); | pnh6->nh_ifp = fib6_get_ifaifp(rte); | ||||
else | else | ||||
pnh6->nh_ifp = rte->rt_ifp; | pnh6->nh_ifp = rte->rt_ifp; | ||||
pnh6->nh_mtu = min(rte->rt_mtu, IN6_LINKMTU(rte->rt_ifp)); | pnh6->nh_mtu = min(rte->rt_mtu, IN6_LINKMTU(rte->rt_ifp)); | ||||
if (rte->rt_flags & RTF_GATEWAY) { | if (rte->rt_flags & RTF_GATEWAY) { | ||||
/* Return address with embedded scope. */ | |||||
gw = (struct sockaddr_in6 *)rte->rt_gateway; | gw = (struct sockaddr_in6 *)rte->rt_gateway; | ||||
pnh6->nh_addr = gw->sin6_addr; | pnh6->nh_addr = gw->sin6_addr; | ||||
in6_clearscope(&pnh6->nh_addr); | |||||
} else | } else | ||||
pnh6->nh_addr = *dst; | pnh6->nh_addr = *dst; | ||||
/* Set flags */ | /* Set flags */ | ||||
pnh6->nh_flags = fib_rte_to_nh_flags(rte->rt_flags); | pnh6->nh_flags = fib_rte_to_nh_flags(rte->rt_flags); | ||||
gw = (struct sockaddr_in6 *)rt_key(rte); | gw = (struct sockaddr_in6 *)rt_key(rte); | ||||
if (IN6_IS_ADDR_UNSPECIFIED(&gw->sin6_addr)) | if (IN6_IS_ADDR_UNSPECIFIED(&gw->sin6_addr)) | ||||
pnh6->nh_flags |= NHF_DEFAULT; | pnh6->nh_flags |= NHF_DEFAULT; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |