Scratch what I said before....

On Wed, Feb 27, 2008 at 01:52:55PM +0100, e-t172 wrote:
> $ cat test.c
> #include <stdlib.h>
> #include <stdio.h>

Putting an #include <net/in.h> here would fix the build....
But why would you ever want to include the below header anyway?
If you want to do iptables stuff, get iptables-dev.

> 
> #include <iproute/iptables.h>
> 
> int main(int argc, char** argv)
> {
>         printf("Hello world\n");
> }
> 
> $ gcc -o test test.c
> In file included from /usr/include/linux/netfilter_ipv4/ip_tables.h:17,


This header file is not part of the iproute package, maybe it should be fixed
up - but file a bug against that package. On the other hand, this i a linux
kernel header and I know they have pretty strict rules on headers including
other headers to avoid circular dependencies or something like that.
Please check what the policy is before filing random bugs without real use.


>                  from /usr/include/libiptc/libiptc.h:6,
>                  from /usr/include/iproute/iptables.h:5,
>                  from test.c:4:
> /usr/include/linux/in.h:26: error: redeclaration of enumerator 
> ‘IPPROTO_IP’
> /usr/include/netinet/in.h:34: error: previous definition of 
> ‘IPPROTO_IP’ was here

[... snip lots of socket definitions missing ...]

> 
> Seems like we have a more general problem here. Maybe I'm doing it 
> wrong, though - but isn't a header in /usr/include expected to be usable 
> anyway ?

Unless you have a real use for any of the headers, I think removing most of
them is the solution. I could only identify libnetlink.h as a header
experting anything that's actually useful to external programs. Out of
curiosity I googled for iproute libnetlink.a rpm and the rpm package of
iproute seems to build a libnetlink-devel package which only contains
libnetlink.a and libnetlink.h, not exporting anything else (in that package,
don't know how to check which binary packages a SRPM builds)...

Including libnetlink.h seems to work just fine, so unless anyone finds
anything else usable in iproute-dev I guess this should be treated as
a wishlist request to "please remove cruft ( == everything except
libnetlink.{a,h} ) from the iproute-dev package".
Less urgent, so I'll leave it until I return from my trip and have another
look at the whole problem with more time at hand then.

-- 
Regards,
Andreas Henriksson



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to