Hi Willy,

Ill give it a try and send the patch as an attachment, though im not 100% comfortable with the code. I think i can do it.
Will take me a few days though..

Thanks sofar.

Op 26-4-2013 23:12, Willy Tarreau schreef:
On Fri, Apr 26, 2013 at 11:03:00PM +0200, PiBa-NL wrote:
Hi Willy / Lukas,

It seams to me OpenBSD doesn't support the IP_BINDANY flag..:
it seems it has, but differently :


While FreeBSD does:

But then again neither of them supports SOL_IP, so i would expect
compilation to simply 'fail'. When trying to compile with the
Which is exactly the reason I don't want to remap these things which
are linux-specific, and instead use the proper call depending on the
available flags. Eg something like this :

#if defined(SOL_IP) && defined(IP_TRANSPARENT)
     /* linux */
     ret = setsockop(fd, SOL_IP, IP_TRANSPARENT, &one, sizeof(one));
#elif defined (IP_PROTOIP) && defined(IP_BINDANY)
     /* freebsd */
     ret = setsockop(fd, IP_PROTOIP, IP_BINDANY, &one, sizeof(one));
#elif defined (IP_PROTOIP) && defined(IP_BINDANY)
     /* openbsd */
     ret = setsockop(fd, SOL_SOCKET, SO_BINDANY, &one, sizeof(one));
     /* unsupported platform */
     ret = -1;

The combination i think is unlikely to cause problems for other
currently working builds/systems..

If you want i can probably come up with a combination that makes it work
for FreeBSD with a special USE_FREEBSD_TPROXY make option.
No, really I think something like above is much better for the long
term. It's more work to adapt existing code first but will pay in the
long term, even in the short term if it allows us to support OpenBSD
at the same time.

Or go for the 'full automatic inclusion' depending on available flags.
Which i think is even 'nicer'. But probably needs more testing to
confirm proper working..
I would be willing to make these changes. Is this the way to go?
As you like, if you feel comfortable with changing the way the current
code works (the linux-specific one), feel free to try, otherwise I can
do it over the week-end, and then a second patch derived from yours will
bring in support for FreeBSD then OpenBSD if someone here is able to
test it.

Thanks for reviewing my proposed changes sofar.
you're welcome :-)


Reply via email to