Gcc error trying to use nf_conntrack->id (dereferencing pointer to incomplete type)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi guys,

I'm trying to use 'id' field of nf_conntrack struct but I'm getting the
following error: "dereferencing pointer to incomplete type".

For example, I've tried to modify conntrack-0.9.6 to print this 'id'
field when "Display a real-time event log":

- ------------------
diff --git a/conntrack-0.9.6/src/conntrack.c
b/conntrack-0.9.6/src/conntrack.c
index 82ff544..8b74564 100644
- --- a/conntrack.c
+++ b/conntrack.c
@@ -603,7 +603,7 @@ static int event_cb(enum nf_conntrack_msg_type type,
        }

        nfct_snprintf(buf, 1024, ct, type, output_type, output_flags);
- -       printf("%s\n", buf);
+       printf("%s id=%u\n", buf, ct->id);
        fflush(stdout);

        return NFCT_CB_CONTINUE;
- ------------------

And tried to compile with gcc 4.3:

- -------------------------
gcc -DPACKAGE_NAME=\"conntrack-tools\"
- -DPACKAGE_TARNAME=\"conntrack-tools\" -DPACKAGE_VERSION=\"0.9.6\"
- -DPACKAGE_STRING=\"conntrack-tools\ 0.9.6\"
- -DPACKAGE_BUGREPORT=\"pablo@xxxxxxxxxxxxx\"
- -DPACKAGE=\"conntrack-tools\" -DVERSION=\"0.9.6\" -DSTDC_HEADERS=1
- -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
- -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
- -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
- -DYYTEXT_POINTER=1 -DHAVE_LINUX_CAPABILITY_H=1 -DHAVE_LIBNFNETLINK=1
- -DHAVE_LIBNETFILTER_CONNTRACK=1 -DHAVE_ARPA_INET_H=1 -DHAVE_INET_PTON=1
- -DHAVE_INET_PTON_IPV6=1 -I.  -I../include   -std=gnu99 -W -Wall -Werror
- -Wmissing-prototypes -Wwrite-strings -Wcast-qual -Wfloat-equal -Wshadow
- -Wpointer-arith -Wbad-function-cast -Wsign-compare -Waggregate-return
- -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline
- -Wstrict-prototypes -Wundef -Wno-unused-parameter -g -O2   -MT
conntrack.o -MD -MP -MF .deps/conntrack.Tpo -c -o conntrack.o conntrack.c
conntrack.c: In function ‘event_cb’:
conntrack.c:606: error: dereferencing pointer to incomplete type
make: ** [conntrack.o] Erro 1
- -------------------------

My gcc version:

~$ gcc --version
gcc (Debian 4.3.2-1.1) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Please, any ideas about what I'm doing wrong?

Thanks for any help!


- -- 
Saudações,

Italo Valcy :: http://wiki.dcc.ufba.br/~ItaloValcy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky5+s8ACgkQfidLqjN6RNHnsQCfVXWpecEHf07HJItjye4tNFyB
RXcAoJuxpwsrlpy3EbaFrm7VjIgl5myu
=sPwU
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux