diff options
author | KOVACS Krisztian <hidden@sch.bme.hu> | 2008-10-01 07:46:49 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-01 07:46:49 -0700 |
commit | a3116ac5c216fc3c145906a46df9ce542ff7dcf2 (patch) | |
tree | 6b2b43b5bacac2b358566e4b7ca0adda45a3e52b /net/ipv4/tcp_output.c | |
parent | 86b08d867d7de001ab224180ed7865fab93fd56e (diff) | |
download | blackbird-obmc-linux-a3116ac5c216fc3c145906a46df9ce542ff7dcf2.tar.gz blackbird-obmc-linux-a3116ac5c216fc3c145906a46df9ce542ff7dcf2.zip |
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>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index a8499ef3234a..493553c71d32 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2275,7 +2275,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, th->syn = 1; th->ack = 1; TCP_ECN_make_synack(req, th); - th->source = inet_sk(sk)->sport; + th->source = ireq->loc_port; th->dest = ireq->rmt_port; /* Setting of flags are superfluous here for callers (and ECE is * not even correctly set) |