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>
This commit is contained in:
ru 2001-12-18 16:13:45 +00:00
parent 54c092ee14
commit 642a135b45
2 changed files with 6 additions and 2 deletions

View File

@ -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 */

View File

@ -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 */