Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_rmx.c
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | in_addroute(void *v_arg, void *n_arg, struct radix_head *head, | ||||
* We also do the same for local addresses, with the thought | * We also do the same for local addresses, with the thought | ||||
* that this might one day be used to speed up ip_input(). | * that this might one day be used to speed up ip_input(). | ||||
* | * | ||||
* We also mark routes to multicast addresses as such, because | * We also mark routes to multicast addresses as such, because | ||||
* it's easy to do and might be useful (but this is much more | * it's easy to do and might be useful (but this is much more | ||||
* dubious since it's so easy to inspect the address). | * dubious since it's so easy to inspect the address). | ||||
*/ | */ | ||||
if (rt->rt_flags & RTF_HOST) { | if (rt->rt_flags & RTF_HOST) { | ||||
if (in_broadcast(sin->sin_addr, rt->rt_ifp)) { | struct epoch_tracker et; | ||||
bool bcast; | |||||
NET_EPOCH_ENTER(et); | |||||
bcast = in_broadcast(sin->sin_addr, rt->rt_ifp); | |||||
NET_EPOCH_EXIT(et); | |||||
if (bcast) | |||||
rt->rt_flags |= RTF_BROADCAST; | rt->rt_flags |= RTF_BROADCAST; | ||||
} else if (satosin(rt->rt_ifa->ifa_addr)->sin_addr.s_addr == | else if (satosin(rt->rt_ifa->ifa_addr)->sin_addr.s_addr == | ||||
sin->sin_addr.s_addr) { | sin->sin_addr.s_addr) | ||||
rt->rt_flags |= RTF_LOCAL; | rt->rt_flags |= RTF_LOCAL; | ||||
} | |||||
} | } | ||||
if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) | if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) | ||||
rt->rt_flags |= RTF_MULTICAST; | rt->rt_flags |= RTF_MULTICAST; | ||||
if (rt->rt_ifp != NULL) { | if (rt->rt_ifp != NULL) { | ||||
/* | /* | ||||
* Check route MTU: | * Check route MTU: | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |