Description of problem: POSIX requires that standard headers should be self-contained. While headers under the linux/ namespace are (obviously) not standardized, it is nicer if they abide by the same rules. It is a pain to have to write applications that pre-include other headers before being able to use a kernel header. Version-Release number of selected component (if applicable): kernel-headers-3.8.0-0.rc3.git0.1.fc19.i686 How reproducible: 100% Steps to Reproduce: 1. cat foo.c 2. gcc -c -Wall foo.c 3. gcc -c -Wall foo.c -DWORKAROUND Actual results: 1. #ifdef WORKAROUND #include <netinet/ip6.h> #endif #include <linux/if_bridge.h> 2. In file included from foo.c:4:0: /usr/include/linux/if_bridge.h:172:20: error: field ‘ip6’ has incomplete type 3. clean compilation Expected results: both 2 and 3 should give clean compilation Additional info: see also https://www.redhat.com/archives/libvir-list/2013-January/msg00930.html for a real-life project impacted by this header bug
Can you report this upstream? 3.8 is still in the -rc phase, so there's a chance it can get fixed by the upstream developers before 3.8 releases.
(In reply to comment #1) > Can you report this upstream? Having never reported an upstream kernel bug before, how best do I go about doing that?
Looks like others are aware of this issue, given that this thread cc'd netdev.org: https://www.redhat.com/archives/libvir-list/2013-January/msg00981.html
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
Is this still an issue with the 3.9 kernels in F19?
Not just in F19, but also rawhide: $ gcc -c -Wall foo.c In file included from foo.c:4:0: /usr/include/linux/if_bridge.h:183:20: error: field ‘ip6’ has incomplete type struct in6_addr ip6; ^ $ rpm -q kernel-headers kernel-headers-3.9.0-0.rc5.git1.1.fc20.i686
*** Bug 949464 has been marked as a duplicate of this bug. ***
when will this be fixed?
Upstream discussion on it is a mess due to conflicting definitions. No clue as to when it will actually be fixed.
Just faced the same problem on F19 using kernel-headers-3.10.4-300.fc19.x86_64. For the record the commit which broke it: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ee07c6e7a6f8a25c18f0a6b18152fbd7499245f6
I just noticed that in the latest rawhide, <netinet/in.h> and <linux/in6.h> no longer clash. Yay! But <linux/if_bridge.h> is still not self-contained :( kernel-headers-3.12.0-0.rc0.git22.2.fc21.x86_64 glibc-2.18.90-1.fc21.x86_64 Proof: $ cat foo.c #ifdef A # include <netinet/in.h> #endif #ifdef B # include <linux/in6.h> #endif #ifdef C # include <linux/if_bridge.h> #endif typedef int dummy; $ gcc -Wall -c -o foo.o foo.c -DC In file included from foo.c:8:0: /usr/include/linux/if_bridge.h:184:20: error: field 'ip6' has incomplete type struct in6_addr ip6; ^ $ gcc -Wall -c -o foo.o foo.c -DA -DC $ gcc -Wall -c -o foo.o foo.c -DB -DC $ gcc -Wall -c -o foo.o foo.c -DA -DB -DC There's hope that we might get this solved yet.
*********** MASS BUG UPDATE ************** We apologize for the inconvenience. There is a large number of bugs to go through and several of them have gone stale. Due to this, we are doing a mass bug update across all of the Fedora 19 kernel bugs. Fedora 19 has now been rebased to 3.11.1-200.fc19. Please test this kernel update and let us know if you issue has been resolved or if it is still present with the newer kernel. If you experience different issues, please open a new bug report for those.
Per comment 11, this bug is still present even in kernel 3.12.0.
*********** MASS BUG UPDATE ************** We apologize for the inconvenience. There is a large number of bugs to go through and several of them have gone stale. Due to this, we are doing a mass bug update across all of the Fedora 19 kernel bugs. Fedora 19 has now been rebased to 3.12.6-200.fc19. Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel. If you have moved on to Fedora 20, and are still experiencing this issue, please change the version to Fedora 20. If you experience different issues, please open a new bug report for those.
Still present in F20.
*********** MASS BUG UPDATE ************** We apologize for the inconvenience. There is a large number of bugs to go through and several of them have gone stale. Due to this, we are doing a mass bug update across all of the Fedora 20 kernel bugs. Fedora 20 has now been rebased to 3.13.4-200.fc20. Please test this kernel update and let us know if you issue has been resolved or if it is still present with the newer kernel. If you experience different issues, please open a new bug report for those.
The issue is still present: $ rpm -q kernel-headers kernel-headers-3.13.4-200.fc20.x86_64 $ cat f.c #ifdef WORKAROUND #include <netinet/ip6.h> #endif #include <linux/if_bridge.h> $ gcc -c -Wall f.c In file included from f.c:4:0: /usr/include/linux/if_bridge.h:184:20: error: field ‘ip6’ has incomplete type struct in6_addr ip6; ^ $ gcc -c -Wall f.c -DWORKAROUND $
*********** MASS BUG UPDATE ************** We apologize for the inconvenience. There is a large number of bugs to go through and several of them have gone stale. Due to this, we are doing a mass bug update across all of the Fedora 20 kernel bugs. Fedora 20 has now been rebased to 3.14.4-200.fc20. Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel. If you experience different issues, please open a new bug report for those.
The issue is still present: $ rpm -q kernel-headers kernel-headers-3.14.4-200.fc20.x86_64 $ cat f.c #ifdef WORKAROUND #include <netinet/ip6.h> #endif #include <linux/if_bridge.h> $ gcc -c -Wall f.c In file included from f.c:5:0: /usr/include/linux/if_bridge.h:184:20: error: field ‘ip6’ has incomplete type struct in6_addr ip6; ^ $ gcc -c -Wall f.c -DWORKAROUND $
*********** MASS BUG UPDATE ************** We apologize for the inconvenience. There is a large number of bugs to go through and several of them have gone stale. Due to this, we are doing a mass bug update across all of the Fedora 20 kernel bugs. Fedora 20 has now been rebased to 3.17.2-200.fc20. Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel. If you have moved on to Fedora 21, and are still experiencing this issue, please change the version to Fedora 21. If you experience different issues, please open a new bug report for those.
The issue is still present: $ rpm -q kernel-headers kernel-headers-3.17.2-200.fc20.x86_64 $ cat f.c #ifdef WORKAROUND #include <netinet/ip6.h> #endif #include <linux/if_bridge.h> $ gcc -c -Wall f.c In file included from f.c:5:0: /usr/include/linux/if_bridge.h:184:20: error: field ‘ip6’ has incomplete type struct in6_addr ip6; ^ $ gcc -c -Wall f.c -DWORKAROUND $
https://lkml.org/lkml/2014/11/5/832 appears to be the fix.
(In reply to Eric Blake from comment #22) > https://lkml.org/lkml/2014/11/5/832 appears to be the fix. OK, that landed in 3.18-rc5 which means it has been fixed in Rawhide for a while now (at least on the kernel side). F20 and F21 will get a 3.18 rebase within the next week or two. The glibc commit required seems to have landed in glibc-2.19 though, which means even when the kernel is fixed for F20 glibc will be lacking the necessary change. F21 has glibc-2.20 and should be fixed. [jwboyer@nuc-i7 ~]$ rpm -q kernel-headers glibc kernel-headers-3.18.1-2.fc22.x86_64 glibc-2.20.90-12.fc22.x86_64 [jwboyer@nuc-i7 ~]$ cat f.c #ifdef WORKAROUND #include <netinet/ip6.h> #endif #include <linux/if_bridge.h> [jwboyer@nuc-i7 ~]$ gcc -c -Wall f.c [jwboyer@nuc-i7 ~]$ Closing this bug out. Thanks for your patience.