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>
This commit is contained in:
committed by
David S. Miller
parent
86b08d867d
commit
a3116ac5c2
@ -61,8 +61,8 @@ struct inet_request_sock {
|
||||
struct request_sock req;
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
u16 inet6_rsk_offset;
|
||||
/* 2 bytes hole, try to pack */
|
||||
#endif
|
||||
__be16 loc_port;
|
||||
__be32 loc_addr;
|
||||
__be32 rmt_addr;
|
||||
__be16 rmt_port;
|
||||
|
Reference in New Issue
Block a user