Re: TPROXY getting the remote/destination address via sockets API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 27/11/2011 3:28 p.m., Brian wrote:
Using the latest TPROXY, how does one accurately get the destination/remote (and the source/localish) addresses of the transparent proxy connection?

Very reliable. At least we (Squid proxy) have had no problems with the kernel 2.6.39+ TPROXY. Just some screwups on our side of the implementation.


I would assume one address would be returned by the accept() call, which one, and how do I get the other?

You assume correct. The other is available from getsockname() on the new FD.

With TPROXY the IPs are reversed. That is; the IP which for normal traffic would arrive on accept() appears instead on getsockname(), and vice versa. So any software receiving TPROXY traffic is required to isolate the listening port from normal traffic listening ports to avoid problems interpreting the IPs.

HTH
AYJ

--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux