diff options
author | andre <andre@FreeBSD.org> | 2004-10-19 14:31:56 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2004-10-19 14:31:56 +0000 |
commit | dcb4801af4f63e7a3401065672bbc87b43a5bdb9 (patch) | |
tree | 832c3aded00fa9986e77a6cf15c66ed4f397c42b /sys/netinet/ip_fastfwd.c | |
parent | 41dc9ace7562e46b5aef6d70ec7030dba3a2b361 (diff) | |
download | FreeBSD-src-dcb4801af4f63e7a3401065672bbc87b43a5bdb9.zip FreeBSD-src-dcb4801af4f63e7a3401065672bbc87b43a5bdb9.tar.gz |
Make comments more clear. Change the order of one if() statement to check the
more likely variable first.
Diffstat (limited to 'sys/netinet/ip_fastfwd.c')
-rw-r--r-- | sys/netinet/ip_fastfwd.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index 9095756..09df699 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -241,6 +241,10 @@ ip_fastforward(struct mbuf *m) ipstat.ips_badsum++; 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); ip_len = ntohs(ip->ip_len); @@ -408,8 +412,9 @@ passin: } /* - * Decrement the TTL and incrementally change the checksum. - * Don't bother doing this with hw checksum offloading. + * Decrement the TTL and incrementally change the IP header checksum. + * Don't bother doing this with hw checksum offloading, it's faster + * doing it right here. */ ip->ip_ttl -= IPTTLDEC; if (ip->ip_sum >= (u_int16_t) ~htons(IPTTLDEC << 8)) @@ -462,7 +467,7 @@ passin: #ifndef IPFIREWALL_FORWARD if (in_localip(dest)) { #else - if (in_localip(dest) || m->m_flags & M_FASTFWD_OURS) { + if (m->m_flags & M_FASTFWD_OURS || in_localip(dest)) { #endif /* IPFIREWALL_FORWARD */ forwardlocal: /* |