Hi Joris,

On Fri, Jun 12, 2015 at 04:45:04PM +0200, joris dedieu wrote:
> > $ git grep -n localtimezone
> > include/common/standard.h:827:char localtimezone[6];
> > src/haproxy.c:588:      strftime(localtimezone, 6, "%z", &curtime);
> > src/standard.c:2340:    memcpy(dst, localtimezone, 5); // timezone
> 
> Done and unfortunately it stills segfaulting. But despite Level3 high
> quality route filtering near lunchtime, I think, I'm not too far. Has
> you suggested I looked at nm output  and found things that make me
> think on struct proxy size.
> 
> I found that there was a link with _COMMON_COMPAT_H defined or not and
> finally with CONFIG_HAP_TRANSPARENT.
> Commenting lines 101 to 108 on include/common/compat.h without other
> modifications stop segfaulting. I will try to continue this way.

Ah, excellent finding. Indeed :

   - struct proxy references struct conn_src
   - struct conn_src's size depends on CONFIG_HAP_TRANSPARENT.
   - CONFIG_HAP_TRANSPARENT is set in compat.h when certain #defines
     are found.

The conditions to set it are defined in compat.h :

#if defined(IP_FREEBIND)       \
 || defined(IP_BINDANY)        \
 || defined(IPV6_BINDANY)      \
 || defined(SO_BINDANY)        \
 || defined(IP_TRANSPARENT)    \
 || defined(IPV6_TRANSPARENT)
#define CONFIG_HAP_TRANSPARENT
#endif

I know that we don't have the same on FreeBSD and Linux, and it's very
likely that the right one depends on certain includes on FreeBSD which
are not set in compat.h, so that depending on what file includes compat.h,
your define is set or not.

I would not be surprized that adding this line to compat.h solves the
problem :

  #include <netinet/in.h>

If it's not this one, please copy the same as in standard.h.
Once you find it, feel free to propose a patch and I'll merge it.

Regards,
Willy


Reply via email to