summaryrefslogtreecommitdiffstats
path: root/sys/netinet/libalias
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-12-18 16:13:45 +0000
committerru <ru@FreeBSD.org>2001-12-18 16:13:45 +0000
commit642a135b454e748e021b30bb5d887d257f819edc (patch)
treea0981b43d850b1db665faf11da05c03166a762c9 /sys/netinet/libalias
parent54c092ee1465a0cfe3f681d89dec3d1407c50367 (diff)
downloadFreeBSD-src-642a135b454e748e021b30bb5d887d257f819edc.zip
FreeBSD-src-642a135b454e748e021b30bb5d887d257f819edc.tar.gz
Fixed the bug in transparent TCP proxying with the "encode_ip_hdr"
option -- TcpAliasOut() did not catch the IP header length change. Submitted by: Stepachev Andrey <aka50@mail.ru>
Diffstat (limited to 'sys/netinet/libalias')
-rw-r--r--sys/netinet/libalias/alias.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c
index 154cf4e..320c5c2 100644
--- a/sys/netinet/libalias/alias.c
+++ b/sys/netinet/libalias/alias.c
@@ -1058,12 +1058,14 @@ TcpAliasOut(struct ip *pip, int maxpacketsize)
u_short *sptr;
/* Save original destination address, if this is a proxy packet.
- Also modify packet to include destination encoding. */
+ Also modify packet to include destination encoding. This may
+ change the size of IP header. */
if (proxy_type != 0)
{
SetProxyPort(link, dest_port);
SetProxyAddress(link, dest_address);
ProxyModify(link, pip, maxpacketsize, proxy_type);
+ tc = (struct tcphdr *) ((char *) pip + (pip->ip_hl << 2));
}
/* Get alias address and port */
OpenPOWER on IntegriCloud