tcp: Port redirection support for TCP
authorKOVACS Krisztian <hidden@sch.bme.hu>
Wed, 1 Oct 2008 14:46:49 +0000 (07:46 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Oct 2008 14:46:49 +0000 (07:46 -0700)
commita3116ac5c216fc3c145906a46df9ce542ff7dcf2
tree6b2b43b5bacac2b358566e4b7ca0adda45a3e52b
parent86b08d867d7de001ab224180ed7865fab93fd56e
tcp: Port redirection support for TCP

Current TCP code relies on the local port of the listening socket
being the same as the destination address of the incoming
connection. Port redirection used by many transparent proxying
techniques obviously breaks this, so we have to store the original
destination port address.

This patch extends struct inet_request_sock and stores the incoming
destination port value there. It also modifies the handshake code to
use that value as the source port when sending reply packets.

Signed-off-by: KOVACS Krisztian <hidden@sch.bme.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_sock.h
include/net/tcp.h
net/ipv4/inet_connection_sock.c
net/ipv4/syncookies.c
net/ipv4/tcp_output.c