Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/ip_output.c
Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | #endif | ||||
ip = mtod(m, struct ip *); | ip = mtod(m, struct ip *); | ||||
ip_len = ntohs(ip->ip_len); | ip_len = ntohs(ip->ip_len); | ||||
ip_off = ntohs(ip->ip_off); | ip_off = ntohs(ip->ip_off); | ||||
if ((flags & (IP_FORWARDING|IP_RAWOUTPUT)) == 0) { | if ((flags & (IP_FORWARDING|IP_RAWOUTPUT)) == 0) { | ||||
ip->ip_v = IPVERSION; | ip->ip_v = IPVERSION; | ||||
ip->ip_hl = hlen >> 2; | ip->ip_hl = hlen >> 2; | ||||
ip_fillid(ip); | ip_fillid(ip); | ||||
IPSTAT_INC(ips_localout); | |||||
} else { | } else { | ||||
/* Header already set, fetch hlen from there */ | /* Header already set, fetch hlen from there */ | ||||
hlen = ip->ip_hl << 2; | hlen = ip->ip_hl << 2; | ||||
} | } | ||||
if ((flags & IP_FORWARDING) == 0) | |||||
IPSTAT_INC(ips_localout); | |||||
/* | /* | ||||
* dst/gw handling: | * dst/gw handling: | ||||
* | * | ||||
* dst can be rewritten but always points to &ro->ro_dst. | * dst can be rewritten but always points to &ro->ro_dst. | ||||
* gw is readonly but can point either to dst OR rt_gateway, | * gw is readonly but can point either to dst OR rt_gateway, | ||||
* therefore we need restore gw if we're redoing lookup. | * therefore we need restore gw if we're redoing lookup. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,184 Lines • Show Last 20 Lines |