summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2000-03-30 02:16:40 +0000
committerjlemon <jlemon@FreeBSD.org>2000-03-30 02:16:40 +0000
commit67671838e97a4d943d2c0724f3be161f83d9b1fe (patch)
tree119916a3baa059e52d778ded923ff861cec3adf2
parent02a6f15567557da3c44026be5727cd3a84cc1ecf (diff)
downloadFreeBSD-src-67671838e97a4d943d2c0724f3be161f83d9b1fe.zip
FreeBSD-src-67671838e97a4d943d2c0724f3be161f83d9b1fe.tar.gz
If `ipfw fwd' loops an mbuf back to ip_input from ip_output and the
mbuf is marked for delayed checksums, then additionally mark the packet as having it's checksums computed. This allows us to bypass computing/checking the checksum entirely, which isn't really needeed as the packet has never hit the wire. Reviewed by: green
-rw-r--r--sys/netinet/ip_output.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index b44765f..9a983a1 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -574,14 +574,15 @@ sendit:
ip_fw_fwd_addr = dst;
if (m->m_pkthdr.rcvif == NULL)
m->m_pkthdr.rcvif = ifunit("lo0");
+ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
+ m->m_pkthdr.csum_flags |=
+ CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
+ m0->m_pkthdr.csum_data = 0xffff;
+ }
+ m->m_pkthdr.csum_flags |=
+ CSUM_IP_CHECKED | CSUM_IP_VALID;
ip->ip_len = htons((u_short)ip->ip_len);
ip->ip_off = htons((u_short)ip->ip_off);
- ip->ip_sum = 0;
- if (ip->ip_vhl == IP_VHL_BORING) {
- ip->ip_sum = in_cksum_hdr(ip);
- } else {
- ip->ip_sum = in_cksum(m, hlen);
- }
ip_input(m);
goto done;
}
OpenPOWER on IntegriCloud