aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorJonathan Lemon <jlemon@FreeBSD.org>2000-03-30 02:16:40 +0000
committerJonathan Lemon <jlemon@FreeBSD.org>2000-03-30 02:16:40 +0000
commit20c822f39977fd31da7c870a5e5a98515b367609 (patch)
treefc3cb4acb5eb52cb0538c8f071bc3c11392a7b20 /sys/netinet/ip_output.c
parent230df2f6375021f6edb6e38cc655167f320e5008 (diff)
downloadsrc-20c822f39977fd31da7c870a5e5a98515b367609.tar.gz
src-20c822f39977fd31da7c870a5e5a98515b367609.zip
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
Notes
Notes: svn path=/head/; revision=58806
Diffstat (limited to 'sys/netinet/ip_output.c')
-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 b44765f909a3..9a983a1a4a89 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;
}