Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/ip_output.c
Show First 20 Lines • Show All 344 Lines • ▼ Show 20 Lines | if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst), | ||||
M_GETFIB(m)))) == NULL) { | M_GETFIB(m)))) == NULL) { | ||||
IPSTAT_INC(ips_noroute); | IPSTAT_INC(ips_noroute); | ||||
error = ENETUNREACH; | error = ENETUNREACH; | ||||
goto bad; | goto bad; | ||||
} | } | ||||
have_ia_ref = 1; | have_ia_ref = 1; | ||||
ifp = ia->ia_ifp; | ifp = ia->ia_ifp; | ||||
ip->ip_ttl = 1; | ip->ip_ttl = 1; | ||||
isbroadcast = in_broadcast(dst->sin_addr, ifp); | isbroadcast = in_ifaddr_broadcast(dst->sin_addr, ia); | ||||
} else if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) && | } else if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) && | ||||
imo != NULL && imo->imo_multicast_ifp != NULL) { | imo != NULL && imo->imo_multicast_ifp != NULL) { | ||||
/* | /* | ||||
* Bypass the normal routing lookup for multicast | * Bypass the normal routing lookup for multicast | ||||
* packets if the interface is specified. | * packets if the interface is specified. | ||||
*/ | */ | ||||
ifp = imo->imo_multicast_ifp; | ifp = imo->imo_multicast_ifp; | ||||
IFP_TO_IA(ifp, ia, &in_ifa_tracker); | IFP_TO_IA(ifp, ia, &in_ifa_tracker); | ||||
Show All 37 Lines | #endif | ||||
ifp = rte->rt_ifp; | ifp = rte->rt_ifp; | ||||
counter_u64_add(rte->rt_pksent, 1); | counter_u64_add(rte->rt_pksent, 1); | ||||
rt_update_ro_flags(ro); | rt_update_ro_flags(ro); | ||||
if (rte->rt_flags & RTF_GATEWAY) | if (rte->rt_flags & RTF_GATEWAY) | ||||
gw = (struct sockaddr_in *)rte->rt_gateway; | gw = (struct sockaddr_in *)rte->rt_gateway; | ||||
if (rte->rt_flags & RTF_HOST) | if (rte->rt_flags & RTF_HOST) | ||||
isbroadcast = (rte->rt_flags & RTF_BROADCAST); | isbroadcast = (rte->rt_flags & RTF_BROADCAST); | ||||
else | else | ||||
isbroadcast = in_broadcast(gw->sin_addr, ifp); | isbroadcast = in_ifaddr_broadcast(gw->sin_addr, ia); | ||||
} | } | ||||
/* | /* | ||||
* Calculate MTU. If we have a route that is up, use that, | * Calculate MTU. If we have a route that is up, use that, | ||||
* otherwise use the interface's MTU. | * otherwise use the interface's MTU. | ||||
*/ | */ | ||||
if (rte != NULL && (rte->rt_flags & (RTF_UP|RTF_HOST))) | if (rte != NULL && (rte->rt_flags & (RTF_UP|RTF_HOST))) | ||||
mtu = rte->rt_mtu; | mtu = rte->rt_mtu; | ||||
▲ Show 20 Lines • Show All 1,003 Lines • Show Last 20 Lines |