[squid-dev] [PATCH] Fix broken cross-include guards in Linux Netfilter code

Amos Jeffries squid3 at treenet.co.nz
Tue Sep 22 14:12:51 UTC 2015


On 22/09/2015 10:00 p.m., Kinkie wrote:
> Hello,
>   recent Linux kernels have a new behavior, by which linux/in.h
> defines some symbols which are also defined in netinet/in.h. This is
> currently causing broken builds on redhat rawhide, but others will
> follow for sure.
> 
> The Linux developers have included some cross-include guards (in
> linux/libc-compat.h); problem is, they are currently not working for
> us.
> 
> The reason for this failure is in this include chain:
> - compat/os/linux.h includes linux/capability.h which which includes
> libc-compat.h.
> libc-compat.h looks for the include-guards of _NETINET_IN_H, which are
> not (yet) defined to define a macro preventing redefinnition of the
> symbols
> - later on, we include netinet/in.h
> - later on, we include linux/if.h which includes linux/in.h
> 
> The attached patch #undef-s the linux/libc-compat.h include guards
> before including any linux/*.h header but after including
> netinet/in.h; this causes libc-compat.h to be reevaluated and the
> correct guards to be defined.
> 
> It's a hack, but it's proven working. The long route would probably
> have to be to  rework compat/os/linux which I'm quite wary of.
> 
> Opinions?

I'd like these bits to be isolated in compat/os/linux.h if at all possible.

NP: this is <http://bugs.squid-cache.org/show_bug.cgi?id=4323>

Amos



More information about the squid-dev mailing list