Make comments more clear. Change the order of one if() statement to check the

more likely variable first.
This commit is contained in:
Andre Oppermann 2004-10-19 14:31:56 +00:00
parent f45cd79a03
commit de1c2ac4bf

View File

@ -241,6 +241,10 @@ ip_fastforward(struct mbuf *m)
ipstat.ips_badsum++; ipstat.ips_badsum++;
goto drop; goto drop;
} }
/*
* Remeber that we have checked the IP header and found it valid.
*/
m->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); m->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID);
ip_len = ntohs(ip->ip_len); ip_len = ntohs(ip->ip_len);
@ -408,8 +412,9 @@ passin:
} }
/* /*
* Decrement the TTL and incrementally change the checksum. * Decrement the TTL and incrementally change the IP header checksum.
* Don't bother doing this with hw checksum offloading. * Don't bother doing this with hw checksum offloading, it's faster
* doing it right here.
*/ */
ip->ip_ttl -= IPTTLDEC; ip->ip_ttl -= IPTTLDEC;
if (ip->ip_sum >= (u_int16_t) ~htons(IPTTLDEC << 8)) if (ip->ip_sum >= (u_int16_t) ~htons(IPTTLDEC << 8))
@ -462,7 +467,7 @@ passin:
#ifndef IPFIREWALL_FORWARD #ifndef IPFIREWALL_FORWARD
if (in_localip(dest)) { if (in_localip(dest)) {
#else #else
if (in_localip(dest) || m->m_flags & M_FASTFWD_OURS) { if (m->m_flags & M_FASTFWD_OURS || in_localip(dest)) {
#endif /* IPFIREWALL_FORWARD */ #endif /* IPFIREWALL_FORWARD */
forwardlocal: forwardlocal:
/* /*