From: nick black <dank@qemfd.net>
To: netdev@oss.sgi.com
Subject: Re: Transparent Proxying
Date: Wed, 11 Aug 2004 20:31:34 +0000 (UTC) [thread overview]
Message-ID: <slrnchl0h5.7vo.dank@hoist.localnet> (raw)
In-Reply-To: 20040804032756.GA2388@gondor.apana.org.au
On 2004-08-04, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> I looked around and found the TPROXY patch which is part of pom-ng.
> It is capable of providing the information I need via a getsockopt()
> call.
I had to do something similar recently. While the entirety of TPROXY
has not been accepted from what I could tell (particularly non-local
binding supplying a routing context), the SO_ORIGINAL_DST sockopt
referenced while searching for it works under at least late 2.4:
struct sockaddr_in daddr;
socklen_t slen;
memset(&daddr,0,sizeof(daddr));
daddr.sin_family = AF_INET;
slen = sizeof(daddr);
if(getsockopt(accepted_sd,SOL_IP,SO_ORIGINAL_DST,&daddr,&slen)){
close(accepted_sd);
return -1;
}
--
nick black "np: the class of dashed hopes and idle dreams."
free hearts, free foreheads -- you and i are old; old age hath yet his honour
and his toil; death closes all: but something ere the end, some work of noble
note, may yet be done, not unbecoming men that strove with gods. (tennyson)
prev parent reply other threads:[~2004-08-11 20:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-04 3:27 Transparent Proxying Herbert Xu
2004-08-04 5:07 ` Herbert Xu
2004-08-11 20:31 ` nick black [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=slrnchl0h5.7vo.dank@hoist.localnet \
--to=dank@qemfd.net \
--cc=dank@reflexsecurity.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).