[tproxy] Re: Development version 1.9.2 released - Oops

James MacLean macleajb@ednet.ns.ca
Mon, 22 Mar 2004 11:46:58 -0400 (AST)

On Mon, 22 Mar 2004, KOVACS Krisztian wrote:

>   No, unfortunately. The ABI changes made the TPROXY_ASSIGN, etc.
> options obsolete. You should try something like this:
> - 8< -
> struct in_tproxy itp;
> itp.op = TPROXY_ASSIGN;
> itp.v.addr.faddr.s_addr = fwdState->src.sin_addr.s_addr;
> itp.v.addr.fport = fwdState->src.sin_port;
> setsockopt(fd, SOL_IP, IP_TPROXY, &itp, sizeof(itp));
> itp.op = TPROXY_FLAGS;
> itp.v.flags = ITP_CONNECT;
> setsockopt(fd, SOL_IP, IP_TPROXY, &itp, sizeof(itp));
> - 8< -

Excellent. Big thanks! I had to add the TPROXY_ALLOC, but I saw my first 
proxy connect complete successfully :). I now need to test it with more 
than one request to make sure it is now correct.
> > Again, sorry to bother. Would appreciate even a pointer to a small code 
> > sample that does the transparent proxy this way that I could learn from.
>   See the tests directory inside the .tar.gz, those are up-to-date code
> covering most of the simple cases.

And now a big "I'm sorry". I looked all over but never even noticed that 
directory in the patches... The examples were exactly what I needed all 
along. Maybe a pointer in the README so thick headed folks like myself do 
not miss them ;)?

Many thanks again,
James B. MacLean        macleajb@ednet.ns.ca
Department of Education 
Nova Scotia, Canada