Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/ip_output.c
Show First 20 Lines • Show All 317 Lines • ▼ Show 20 Lines | |||||
ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, | ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, | ||||
struct ip_moptions *imo, struct inpcb *inp) | struct ip_moptions *imo, struct inpcb *inp) | ||||
{ | { | ||||
struct rm_priotracker in_ifa_tracker; | struct rm_priotracker in_ifa_tracker; | ||||
struct ip *ip; | struct ip *ip; | ||||
struct ifnet *ifp = NULL; /* keep compiler happy */ | struct ifnet *ifp = NULL; /* keep compiler happy */ | ||||
struct mbuf *m0; | struct mbuf *m0; | ||||
int hlen = sizeof (struct ip); | int hlen = sizeof (struct ip); | ||||
int mtu; | int mtu = 0; | ||||
int error = 0; | int error = 0; | ||||
struct sockaddr_in *dst, sin; | struct sockaddr_in *dst, sin; | ||||
const struct sockaddr_in *gw; | const struct sockaddr_in *gw; | ||||
struct in_ifaddr *ia; | struct in_ifaddr *ia = NULL; | ||||
struct in_addr src; | struct in_addr src; | ||||
int isbroadcast; | int isbroadcast; | ||||
uint16_t ip_len, ip_off; | uint16_t ip_len, ip_off; | ||||
uint32_t fibnum; | uint32_t fibnum; | ||||
#if defined(IPSEC) || defined(IPSEC_SUPPORT) | #if defined(IPSEC) || defined(IPSEC_SUPPORT) | ||||
int no_route_but_check_spd = 0; | int no_route_but_check_spd = 0; | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | #endif | ||||
if (ro->ro_nh == NULL || (!NH_IS_VALID(ro->ro_nh))) { | if (ro->ro_nh == NULL || (!NH_IS_VALID(ro->ro_nh))) { | ||||
#if defined(IPSEC) || defined(IPSEC_SUPPORT) | #if defined(IPSEC) || defined(IPSEC_SUPPORT) | ||||
/* | /* | ||||
* There is no route for this packet, but it is | * There is no route for this packet, but it is | ||||
* possible that a matching SPD entry exists. | * possible that a matching SPD entry exists. | ||||
*/ | */ | ||||
no_route_but_check_spd = 1; | no_route_but_check_spd = 1; | ||||
mtu = 0; /* Silence GCC warning. */ | |||||
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); | ia = ifatoia(ro->ro_nh->nh_ifa); | ||||
Show All 19 Lines | #endif | ||||
nh = fib4_lookup(M_GETFIB(m), ip->ip_dst, 0, NHR_NONE, 0); | nh = fib4_lookup(M_GETFIB(m), ip->ip_dst, 0, NHR_NONE, 0); | ||||
if (nh == NULL) { | if (nh == NULL) { | ||||
#if defined(IPSEC) || defined(IPSEC_SUPPORT) | #if defined(IPSEC) || defined(IPSEC_SUPPORT) | ||||
/* | /* | ||||
* There is no route for this packet, but it is | * There is no route for this packet, but it is | ||||
* possible that a matching SPD entry exists. | * possible that a matching SPD entry exists. | ||||
*/ | */ | ||||
no_route_but_check_spd = 1; | no_route_but_check_spd = 1; | ||||
mtu = 0; /* Silence GCC warning. */ | |||||
goto sendit; | goto sendit; | ||||
#endif | #endif | ||||
IPSTAT_INC(ips_noroute); | IPSTAT_INC(ips_noroute); | ||||
error = EHOSTUNREACH; | error = EHOSTUNREACH; | ||||
goto bad; | goto bad; | ||||
} | } | ||||
ifp = nh->nh_ifp; | ifp = nh->nh_ifp; | ||||
mtu = nh->nh_mtu; | mtu = nh->nh_mtu; | ||||
▲ Show 20 Lines • Show All 1,061 Lines • Show Last 20 Lines |