summaryrefslogtreecommitdiffstats
path: root/sys/netinet/libalias/alias_proxy.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_proxy.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_proxy.c')
-rw-r--r--sys/netinet/libalias/alias_proxy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netinet/libalias/alias_proxy.c b/sys/netinet/libalias/alias_proxy.c
index b2789f3..f683ba0 100644
--- a/sys/netinet/libalias/alias_proxy.c
+++ b/sys/netinet/libalias/alias_proxy.c
@@ -474,7 +474,11 @@ ProxyEncodeTcpStream(struct alias_link *lnk,
already changed. */
tc->th_sum = 0;
+#ifdef _KERNEL
+ tc->th_x2 = 1;
+#else
tc->th_sum = TcpChecksum(pip);
+#endif
}
static void
OpenPOWER on IntegriCloud