aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/syncookies.c
diff options
context:
space:
mode:
authorKOVACS Krisztian <hidden@sch.bme.hu>2008-10-01 10:46:49 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-01 10:46:49 -0400
commita3116ac5c216fc3c145906a46df9ce542ff7dcf2 (patch)
tree6b2b43b5bacac2b358566e4b7ca0adda45a3e52b /net/ipv4/syncookies.c
parent86b08d867d7de001ab224180ed7865fab93fd56e (diff)
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/syncookies.c')
-rw-r--r--net/ipv4/syncookies.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 929302b2ba94..d346c22aa6ae 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -297,6 +297,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
297 treq->rcv_isn = ntohl(th->seq) - 1; 297 treq->rcv_isn = ntohl(th->seq) - 1;
298 treq->snt_isn = cookie; 298 treq->snt_isn = cookie;
299 req->mss = mss; 299 req->mss = mss;
300 ireq->loc_port = th->dest;
300 ireq->rmt_port = th->source; 301 ireq->rmt_port = th->source;
301 ireq->loc_addr = ip_hdr(skb)->daddr; 302 ireq->loc_addr = ip_hdr(skb)->daddr;
302 ireq->rmt_addr = ip_hdr(skb)->saddr; 303 ireq->rmt_addr = ip_hdr(skb)->saddr;