Skip to contentSkip to conversation

libnfnetlink.h include generates problems...

DISCUSSION aton 3 participants 8 messages Jun 11, 2007 – Jun 13, 2007 netfilter

lore
Share & tools
lore

aton

author
#0 lore raw

in one of my programs, i include the following two files:

#include <linux/netfilter.h>
#include <libnetfilter_queue/libnetfilter_queue.h>

while a few of my header files include each other i get errors from these nfqueue header:

In file included from /usr/include/sys/uio.h:24,

                 from /usr/include/sys/socket.h:27,
                 from /usr/local/include/libnfnetlink/libnfnetlink.h:19,
                 from
/usr/local/include/libnetfilter_queue/libnetfilter_queue.h:16,
                 from misc.h:14,
                 from packeter.c:9:

/usr/include/sys/types.h:62: error: conflicting types for 'dev_t' /usr/include/linux/types.h:27: error: previous declaration of 'dev_t' was here
/usr/include/sys/types.h:72: error: conflicting types for 'mode_t' /usr/include/linux/types.h:33: error: previous declaration of 'mode_t' was here
/usr/include/sys/types.h:77: error: conflicting types for 'nlink_t' /usr/include/linux/types.h:36: error: previous declaration of 'nlink_t' was here
etc. etc.

i talked to some guys from ##c on freenode, and they said, probably libnfnetlink.h should not directly include linux/types.h

sorry if this is my mistake, i am not very good at this stuff

greetings, aton

#1 lore raw

Hi,

Quoted 8 lines · aton

in one of my programs, i include the following two files:

#include <linux/netfilter.h>
#include <libnetfilter_queue/libnetfilter_queue.h>

while a few of my header files include each other i get errors from these nfqueue header:

Quoted 7 lines

In file included from /usr/include/sys/uio.h:24, /usr/include/sys/types.h:62: error: conflicting types for 'dev_t' /usr/include/linux/types.h:27: error: previous declaration of 'dev_t' was here

i talked to some guys from ##c on freenode, and they said, probably libnfnetlink.h should not directly include linux/types.h

This seems to be the case as we discus on #netfilter. I'm sending two patches which fix this issue.

BR,

Signature · 2 lines
Eric Leblond <[email protected]>
INL
#2 lore raw

Hi,

Here's the patch for libnfnetlink.

BR,

Signature · 2 lines
Eric Leblond <[email protected]>
INL
libnfnetlink/libnfnetlink.h +0 -1
Index: include/libnfnetlink/libnfnetlink.h
===================================================================
@@ -16,7 +16,6 @@
 #endif
 
 #include <sys/socket.h>	/* for sa_family_t */
-#include <linux/types.h>
 #include <linux/netlink.h>
 #include <libnfnetlink/linux_nfnetlink.h>
 
#4 lore raw
In reply to Eric Leblond

Hi,

Here's the patch for libnetilter_queue.

BR,

Signature · 2 lines
Eric Leblond <[email protected]>
INL
libnetfilter_queue/linux_nfnetlink_queue.h +0 -1
Index: include/libnetfilter_queue/linux_nfnetlink_queue.h
===================================================================
@@ -5,7 +5,6 @@
 #define aligned_u64 unsigned long long __attribute__((aligned(8)))
 #endif
 
-#include <linux/types.h>
 #include <libnfnetlink/linux_nfnetlink.h>
 
 enum nfqnl_msg_types {
#5 lore raw
In reply to aton
Quoted 26 lines · aton

in one of my programs, i include the following two files:

#include <linux/netfilter.h>
#include <libnetfilter_queue/libnetfilter_queue.h>

while a few of my header files include each other i get errors from these nfqueue header:

In file included from /usr/include/sys/uio.h:24,

                 from /usr/include/sys/socket.h:27,
                 from /usr/local/include/libnfnetlink/libnfnetlink.h:19,
                 from
/usr/local/include/libnetfilter_queue/libnetfilter_queue.h:16,
                 from misc.h:14,
                 from packeter.c:9:

/usr/include/sys/types.h:62: error: conflicting types for 'dev_t' /usr/include/linux/types.h:27: error: previous declaration of 'dev_t' was here
/usr/include/sys/types.h:72: error: conflicting types for 'mode_t' /usr/include/linux/types.h:33: error: previous declaration of 'mode_t' was here
/usr/include/sys/types.h:77: error: conflicting types for 'nlink_t' /usr/include/linux/types.h:36: error: previous declaration of 'nlink_t' was here
etc. etc.

Quoted 2 lines

i talked to some guys from ##c on freenode, and they said, probably libnfnetlink.h should not directly include linux/types.h

What version of libnfnetlink are you using? This problem is supposed to be fixed already in 0.0.25.

Signature · 2 lines
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris
author
#6 lore raw
Quoted 27 lines · Pablo Neira Ayuso
Quoted 26 lines · aton

in one of my programs, i include the following two files:

#include <linux/netfilter.h>
#include <libnetfilter_queue/libnetfilter_queue.h>

while a few of my header files include each other i get errors from these nfqueue header:

In file included from /usr/include/sys/uio.h:24,

                 from /usr/include/sys/socket.h:27,
                 from /usr/local/include/libnfnetlink/libnfnetlink.h:19,
                 from
/usr/local/include/libnetfilter_queue/libnetfilter_queue.h:16,
                 from misc.h:14,
                 from packeter.c:9:

/usr/include/sys/types.h:62: error: conflicting types for 'dev_t' /usr/include/linux/types.h:27: error: previous declaration of 'dev_t' was here
/usr/include/sys/types.h:72: error: conflicting types for 'mode_t' /usr/include/linux/types.h:33: error: previous declaration of 'mode_t' was here
/usr/include/sys/types.h:77: error: conflicting types for 'nlink_t' /usr/include/linux/types.h:36: error: previous declaration of 'nlink_t' was here
etc. etc.

Quoted 6 lines
Quoted 2 lines

i talked to some guys from ##c on freenode, and they said, probably libnfnetlink.h should not directly include linux/types.h

What version of libnfnetlink are you using? This problem is supposed to be fixed already in 0.0.25.

i am using libnfnetlink-0.0.25 and libnetfilter_queue-0.0.13. i compiled it myself and did not use the packaged version of the gentoo portage system

#7 lore raw
Quoted 28 lines · aton
Quoted 27 lines · Pablo Neira Ayuso
Quoted 26 lines · aton

in one of my programs, i include the following two files:

#include <linux/netfilter.h>
#include <libnetfilter_queue/libnetfilter_queue.h>

while a few of my header files include each other i get errors from these nfqueue header:

In file included from /usr/include/sys/uio.h:24,

                 from /usr/include/sys/socket.h:27,
                 from /usr/local/include/libnfnetlink/libnfnetlink.h:19,
                 from
/usr/local/include/libnetfilter_queue/libnetfilter_queue.h:16,
                 from misc.h:14,
                 from packeter.c:9:

/usr/include/sys/types.h:62: error: conflicting types for 'dev_t' /usr/include/linux/types.h:27: error: previous declaration of 'dev_t' was here
/usr/include/sys/types.h:72: error: conflicting types for 'mode_t' /usr/include/linux/types.h:33: error: previous declaration of 'mode_t' was here
/usr/include/sys/types.h:77: error: conflicting types for 'nlink_t' /usr/include/linux/types.h:36: error: previous declaration of 'nlink_t' was here
etc. etc.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

i talked to some guys from ##c on freenode, and they said, probably libnfnetlink.h should not directly include linux/types.h

What version of libnfnetlink are you using? This problem is supposed to be fixed already in 0.0.25.

i am using libnfnetlink-0.0.25 and libnetfilter_queue-0.0.13. i compiled it myself and did not use the packaged version of the gentoo portage system

ACK. I'll apply Eric's patches asap.

Signature · 1 line
The dawn of the fourth age of Linux firewalling is coming; a time of great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris
#3 lore raw
In reply to Eric Leblond
Quoted 1 line · Eric Leblond

Here's the patch for libnfnetlink.

Both applied. Thanks Eric.

Signature · 2 lines
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris