After emerged latest stable sys-kernel/linux-headers (4.13), I failed to re-emerge net-misc/quagga (a rebuild initiated by readline update). gcc outputs a lot of things like "error: redeclaration of enumerator 'IPPROTO_IP'". Starting from linux-4.11 [commit bcb41c6bced1ee778d23c53a6b4807fb08cf5540], linux/mroute.h includes linux/in.h , that finally makes gcc roar. 1) lib/zebra.h includes sys/capability.h first, then includes netinet/in.h . 2) In sys/capability.h, it includes linux/xattr.h, and that includes linux/libc-compat.h . 3) Since at that time netinet/in.h is not included yet, _NETINET_IN_H is not defined, causing libc-compat.h set __UAPI_DEF_IN_IPPROTO to 1. 4) Then, a include of netinet/in.h defines IPPROTO_IP. Later a include of linux/mroute.h(in pimd/pimd.h) includes linux/in.h. 5) Because __UAPI_DEF_IN_IPPROTO is set to non zero, IPPROTO_IP is redeclared. I had also sent a mail to maintainers [at] quagga.net about this, recommending including netinet/in.h earlier in zebra.h.
Confirm on amd64
Thank you for the report. Please *attach* the logfiles, https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket and reopen this ticket (Status:unconfirmed).
Created attachment 515828 [details, diff] patch for including netinet/in.h earlier in zebra.h Requested patch including netinet/in.h earlier in zebra.h net-misc/quagga compiles with sys-kernel/linux-headers-4.13.
Fixed at http://git.savannah.gnu.org/cgit/quagga.git/commit/?id=fed50218deeaef4d996d25c45b1aa56fe5e337c4 First release containing the fix is 1.2.4
This also sounds like a problem worth reporting to the kernel mailing list so they can fix their headers.
*** Bug 645924 has been marked as a duplicate of this bug. ***