summaryrefslogtreecommitdiffstats
path: root/sys/netinet/libalias/alias_ftp.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-06-27 07:36:02 +0000
committerglebius <glebius@FreeBSD.org>2005-06-27 07:36:02 +0000
commitc6e57e046e743ecb35b9a7c48c8fb5e6d30b6ac1 (patch)
tree31bc69409e5f746eb4521a8499f88fae66f48cbb /sys/netinet/libalias/alias_ftp.c
parent49d602bcb1eba547fdc15540603f3f9303f3418a (diff)
downloadFreeBSD-src-c6e57e046e743ecb35b9a7c48c8fb5e6d30b6ac1.zip
FreeBSD-src-c6e57e046e743ecb35b9a7c48c8fb5e6d30b6ac1.tar.gz
Disable checksum processing in LibAlias, when it works as a
kernel module. LibAlias is not aware about checksum offloading, so the caller should provide checksum calculation. (The only current consumer is ng_nat(4)). When TCP packet internals has been changed and it requires checksum recalculation, a cookie is set in th_x2 field of TCP packet, to inform caller that it needs to recalculate checksum. This ugly hack would be removed when LibAlias is made more kernel friendly. Incremental checksum updates are left as is, since they don't conflict with offloading. Approved by: re (scottl)
Diffstat (limited to 'sys/netinet/libalias/alias_ftp.c')
-rw-r--r--sys/netinet/libalias/alias_ftp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netinet/libalias/alias_ftp.c b/sys/netinet/libalias/alias_ftp.c
index 2eb8859..d91e1cd 100644
--- a/sys/netinet/libalias/alias_ftp.c
+++ b/sys/netinet/libalias/alias_ftp.c
@@ -677,7 +677,11 @@ NewFtpMessage(struct libalias *la, struct ip *pip,
/* Compute TCP checksum for revised packet */
tc->th_sum = 0;
+#ifdef _KERNEL
+ tc->th_x2 = 1;
+#else
tc->th_sum = TcpChecksum(pip);
+#endif
} else {
#ifdef LIBALIAS_DEBUG
fprintf(stderr,
OpenPOWER on IntegriCloud