* TPROXY getting the remote/destination address via sockets API
@ 2011-11-27 2:28 Brian
2011-11-27 3:56 ` Amos Jeffries
0 siblings, 1 reply; 2+ messages in thread
From: Brian @ 2011-11-27 2:28 UTC (permalink / raw)
To: netfilter
Using the latest TPROXY, how does one accurately get the
destination/remote (and the source/localish) addresses of the
transparent proxy connection?
I would assume one address would be returned by the accept() call, which
one, and how do I get the other?
Thanks,
Brian
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: TPROXY getting the remote/destination address via sockets API
2011-11-27 2:28 TPROXY getting the remote/destination address via sockets API Brian
@ 2011-11-27 3:56 ` Amos Jeffries
0 siblings, 0 replies; 2+ messages in thread
From: Amos Jeffries @ 2011-11-27 3:56 UTC (permalink / raw)
To: Brian; +Cc: netfilter
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-27 3:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-27 2:28 TPROXY getting the remote/destination address via sockets API Brian
2011-11-27 3:56 ` Amos Jeffries
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.