package sys-kernel/linux-headers-2.6.36.1 linux/in.h is not patched as in linux-headers-2.6.30-r1 when include both linux/in.h and netinet/in.h, following compile error shows: /usr/include/linux/in.h:26: error: redeclaration of enumerator ‘IPPROTO_IP’ /usr/include/netinet/in.h:34: note: previous definition of ‘IPPROTO_IP’ was here ... I checked linux-headers-2.6.30-r1, 00_all_0008-HACK-linux-pull-in-C-library-headers.patch is not included in linux-headers-2.6.36.1 Reproducible: Always Steps to Reproduce: $ cat a.c #include <netinet/in.h> #include <linux/in.h> $ LANG=C gcc -c a.c In file included from a.c:2: /usr/include/linux/in.h:26: error: redeclaration of enumerator 'IPPROTO_IP' /usr/include/netinet/in.h:34: note: previous definition of 'IPPROTO_IP' was here ...
dont include both
Why we won't fix this? There is a clear description for the purpose of patch in linux-headers-2.6.30-r1, so we don't care the reason there? For me, I use one socket option IP_TRANSPARENT in my program. This option is for linux only at present, so after upgrade linux-headers to 2.6.36.1, the program failed to compile. The only solution for me is to not include linux/in.h but define the option myself, this is obviously not a portable solution. Also, I see there are several other socket options are linux specific, the program use those options will face the same problem.
take it up with lkml