Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_output.c
Show First 20 Lines • Show All 287 Lines • ▼ Show 20 Lines | #ifdef RATELIMIT | ||||
if (error == EAGAIN) | if (error == EAGAIN) | ||||
in_pcboutput_eagain(inp); | in_pcboutput_eagain(inp); | ||||
#endif | #endif | ||||
return (error); | return (error); | ||||
} | } | ||||
/* rte<>ro_flags translation */ | /* rte<>ro_flags translation */ | ||||
static inline void | static inline void | ||||
rt_update_ro_flags(struct route *ro) | rt_update_ro_flags(struct route *ro, const struct nhop_object *nh) | ||||
{ | { | ||||
int nh_flags = ro->ro_nh->nh_flags; | int nh_flags = nh->nh_flags; | ||||
ro->ro_flags &= ~ (RT_REJECT|RT_BLACKHOLE|RT_HAS_GW); | ro->ro_flags &= ~ (RT_REJECT|RT_BLACKHOLE|RT_HAS_GW); | ||||
ro->ro_flags |= (nh_flags & NHF_REJECT) ? RT_REJECT : 0; | ro->ro_flags |= (nh_flags & NHF_REJECT) ? RT_REJECT : 0; | ||||
ro->ro_flags |= (nh_flags & NHF_BLACKHOLE) ? RT_BLACKHOLE : 0; | ro->ro_flags |= (nh_flags & NHF_BLACKHOLE) ? RT_BLACKHOLE : 0; | ||||
ro->ro_flags |= (nh_flags & NHF_GATEWAY) ? RT_HAS_GW : 0; | ro->ro_flags |= (nh_flags & NHF_GATEWAY) ? RT_HAS_GW : 0; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | #if defined(IPSEC) || defined(IPSEC_SUPPORT) | ||||
no_route_but_check_spd = 1; | no_route_but_check_spd = 1; | ||||
goto sendit; | goto sendit; | ||||
#endif | #endif | ||||
IPSTAT_INC(ips_noroute); | IPSTAT_INC(ips_noroute); | ||||
error = EHOSTUNREACH; | error = EHOSTUNREACH; | ||||
goto bad; | goto bad; | ||||
} | } | ||||
} | } | ||||
ia = ifatoia(ro->ro_nh->nh_ifa); | struct nhop_object *nh = ro->ro_nh; | ||||
ifp = ro->ro_nh->nh_ifp; | |||||
counter_u64_add(ro->ro_nh->nh_pksent, 1); | ia = ifatoia(nh->nh_ifa); | ||||
rt_update_ro_flags(ro); | ifp = nh->nh_ifp; | ||||
if (ro->ro_nh->nh_flags & NHF_GATEWAY) | counter_u64_add(nh->nh_pksent, 1); | ||||
gw = &ro->ro_nh->gw4_sa; | rt_update_ro_flags(ro, nh); | ||||
if (ro->ro_nh->nh_flags & NHF_HOST) | if (nh->nh_flags & NHF_GATEWAY) | ||||
isbroadcast = (ro->ro_nh->nh_flags & NHF_BROADCAST); | gw = &nh->gw4_sa; | ||||
if (nh->nh_flags & NHF_HOST) | |||||
isbroadcast = (nh->nh_flags & NHF_BROADCAST); | |||||
else if (ifp->if_flags & IFF_BROADCAST) | else if (ifp->if_flags & IFF_BROADCAST) | ||||
isbroadcast = in_ifaddr_broadcast(gw->sin_addr, ia); | isbroadcast = in_ifaddr_broadcast(gw->sin_addr, ia); | ||||
else | else | ||||
isbroadcast = 0; | isbroadcast = 0; | ||||
if (ro->ro_nh->nh_flags & NHF_HOST) | mtu = nh->nh_mtu; | ||||
mtu = ro->ro_nh->nh_mtu; | |||||
else | |||||
mtu = ifp->if_mtu; | |||||
src = IA_SIN(ia)->sin_addr; | src = IA_SIN(ia)->sin_addr; | ||||
} else { | } else { | ||||
struct nhop_object *nh; | struct nhop_object *nh; | ||||
nh = fib4_lookup(M_GETFIB(m), ip->ip_dst, 0, NHR_NONE, | nh = fib4_lookup(M_GETFIB(m), ip->ip_dst, 0, NHR_NONE, | ||||
m->m_pkthdr.flowid); | m->m_pkthdr.flowid); | ||||
if (nh == NULL) { | if (nh == NULL) { | ||||
#if defined(IPSEC) || defined(IPSEC_SUPPORT) | #if defined(IPSEC) || defined(IPSEC_SUPPORT) | ||||
▲ Show 20 Lines • Show All 1,112 Lines • Show Last 20 Lines |