Page 1 of 1

attempting to install perl module IPTables::IPV4

PostPosted: Dec 8th, '13, 18:50
by linuxdad
Hmm, no sure what is going on or missing from this, does anyone have a suggestion on how to resolve this??

Code: Select all
[root@ns IPTables-IPv4-0.98-oM4HY7]# make
make -C libiptc/ all
make[1]: Entering directory `/root/.local/share/.cpan/build/IPTables-IPv4-0.98-oM4HY7/libiptc'
gcc -o libip4tc.o -c libip4tc.c -I../include -I/usr/src/linux/include -DIPTABLES_VERSION=\"1.2.8\" -O2 -Wall
In file included from libip4tc.c:116:0:
libiptc.c:62:8: error: redefinition of âstruct xt_error_targetâ
In file included from /usr/include/linux/netfilter_ipv4/ip_tables.h:22:0,
                 from ../include/libiptc/libiptc.h:6,
                 from libip4tc.c:29:
/usr/include/linux/netfilter/x_tables.h:69:8: note: originally defined here
In file included from libip4tc.c:116:0:
libiptc.c: In function âiptc_initâ:
libiptc.c:312:10: warning: pointer targets in passing argument 5 of âgetsockoptâ differ in signedness [-Wpointer-sign]
In file included from /usr/include/netinet/in.h:24:0,
                 from /usr/include/netinet/ip.h:24,
                 from ../include/libiptc/ipt_kernel_headers.h:9,
                 from ../include/libiptc/libiptc.h:5,
                 from libip4tc.c:29:
/usr/include/sys/socket.h:220:12: note: expected âsocklen_t * __restrict__â but argument is of type âint *â
In file included from libip4tc.c:116:0:
libiptc.c: In function âtarget_nameâ:
libiptc.c:727:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
libiptc.c: In function âiptc_zero_counterâ:
libiptc.c:1396:16: warning: variable âeâ set but not used [-Wunused-but-set-variable]
libip4tc.c: In function âdump_entryâ:
libip4tc.c:170:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
make[1]: *** [libip4tc.o] Error 1
make[1]: Leaving directory `/root/.local/share/.cpan/build/IPTables-IPv4-0.98-oM4HY7/libiptc'
make: *** [libiptc/libiptc.a] Error 2
[root@ns IPTables-IPv4-0.98-oM4HY7]# perl Makefile.PL
Generating a Unix-style Makefile
Writing Makefile for IPTables::IPv4
Writing MYMETA.yml and MYMETA.json

Code: Select all
[root@ns IPTables-IPv4-0.98-oM4HY7]# make
Skip blib/lib/IPTables/IPv4/TableTie.pm (unchanged)
Skip blib/lib/IPTables/IPv4/Chain.pm (unchanged)
Skip blib/lib/IPTables/IPv4.pm (unchanged)
Skip blib/lib/IPTables/IPv6.pm (unchanged)
Skip blib/lib/IPTables/IPv4/Toplevel.pm (unchanged)
Skip blib/lib/IPTables/IPv4/Rule.pm (unchanged)
Skip blib/lib/IPTables/IPv4/RuleList.pm (unchanged)
Running Mkbootstrap for IPTables::IPv4 ()
chmod 644 IPv4.bs
gcc -c  -Iinclude -I/usr/src/linux/include -Wall -DMODULE_PATH=\"/usr/lib/IPTables-IPv4\" -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wl,--as-needed -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -pthread   -DVERSION=\"0.98\" -DXS_VERSION=\"0.98\" -fPIC "-I/usr/lib/perl5/5.16.3/i386-linux-thread-multi/CORE"   IPv4.c
IPv4.c: In function âXS_IPTables__IPv4__Table_list_chainsâ:
IPv4.xs:78:9: warning: variable âsvâ set but not used [-Wunused-but-set-variable]
IPv4.c: In function âXS_IPTables__IPv4__Table_list_rulesâ:
IPv4.xs:97:11: warning: variable âsvâ set but not used [-Wunused-but-set-variable]
IPv4.c: In function âXS_IPTables__IPv4__Table_get_policyâ:
IPv4.xs:129:11: warning: variable âsvâ set but not used [-Wunused-but-set-variable]
IPv4.xs: In function âXS_IPTables__IPv4__Table_get_referencesâ:
IPv4.xs:379:3: warning: pointer targets in passing argument 1 of âiptc_get_referencesâ differ in signedness [-Wpointer-sign]
In file included from IPv4.xs:28:0:
include/libiptc/libiptc.h:132:5: note: expected âunsigned int *â but argument is of type âint *â
IPv4.c: In function âXS_IPTables__IPv4__Table_get_policyâ:
IPv4.xs:136:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
IPv4.xs:139:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
gcc -c  -Iinclude -I/usr/src/linux/include -Wall -DMODULE_PATH=\"/usr/lib/IPTables-IPv4\" -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wl,--as-needed -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -pthread   -DVERSION=\"0.98\" -DXS_VERSION=\"0.98\" -fPIC "-I/usr/lib/perl5/5.16.3/i386-linux-thread-multi/CORE"   loader.c
loader.c: In function âfind_module_intâ:
loader.c:108:11: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
gcc -c  -Iinclude -I/usr/src/linux/include -Wall -DMODULE_PATH=\"/usr/lib/IPTables-IPv4\" -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wl,--as-needed -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -pthread   -DVERSION=\"0.98\" -DXS_VERSION=\"0.98\" -fPIC "-I/usr/lib/perl5/5.16.3/i386-linux-thread-multi/CORE"   packer.c
packer.c: In function âipt_do_packâ:
packer.c:249:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
packer.c:310:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
packer.c:372:10: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
packer.c:542:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
packer.c:558:13: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
In file included from /usr/include/string.h:638:0,
                 from /usr/lib/perl5/5.16.3/i386-linux-thread-multi/CORE/perl.h:1003,
                 from packer.c:26:
In function âstrncpyâ,
    inlined from âipt_do_packâ at packer.c:269:12:
/usr/include/bits/string3.h:120:3: warning: call to __builtin___strncpy_chk will always overflow destination buffer [enabled by default]
In function âstrncpyâ,
    inlined from âipt_do_packâ at packer.c:339:11:
/usr/include/bits/string3.h:120:3: warning: call to __builtin___strncpy_chk will always overflow destination buffer [enabled by default]
In function âstrncpyâ,
    inlined from âipt_do_packâ at packer.c:394:9:
/usr/include/bits/string3.h:120:3: warning: call to __builtin___strncpy_chk will always overflow destination buffer [enabled by default]
/usr/include/bits/string3.h:120:3: warning: call to __builtin___strncpy_chk will always overflow destination buffer [enabled by default]
In function âstrncpyâ,
    inlined from âipt_do_packâ at packer.c:594:12:
/usr/include/bits/string3.h:120:3: warning: call to __builtin___strncpy_chk will always overflow destination buffer [enabled by default]
In function âstrncpyâ,
    inlined from âipt_do_packâ at packer.c:394:9:
/usr/include/bits/string3.h:120:3: warning: call to __builtin___strncpy_chk will always overflow destination buffer [enabled by default]
/usr/include/bits/string3.h:120:3: warning: call to __builtin___strncpy_chk will always overflow destination buffer [enabled by default]
gcc -c  -Iinclude -I/usr/src/linux/include -Wall -DMODULE_PATH=\"/usr/lib/IPTables-IPv4\" -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wl,--as-needed -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -pthread   -DVERSION=\"0.98\" -DXS_VERSION=\"0.98\" -fPIC "-I/usr/lib/perl5/5.16.3/i386-linux-thread-multi/CORE"   unpacker.c
unpacker.c: In function âipt_do_unpackâ:
unpacker.c:132:3: warning: value computed is not used [-Wunused-value]
unpacker.c:139:3: warning: value computed is not used [-Wunused-value]
unpacker.c:150:3: warning: value computed is not used [-Wunused-value]
unpacker.c:162:3: warning: value computed is not used [-Wunused-value]
unpacker.c:189:3: warning: value computed is not used [-Wunused-value]
unpacker.c:195:3: warning: value computed is not used [-Wunused-value]
unpacker.c:204:4: warning: value computed is not used [-Wunused-value]
unpacker.c:217:5: warning: value computed is not used [-Wunused-value]
unpacker.c:252:4: warning: value computed is not used [-Wunused-value]
unpacker.c:261:3: warning: value computed is not used [-Wunused-value]
unpacker.c:265:2: warning: value computed is not used [-Wunused-value]
unpacker.c:268:2: warning: value computed is not used [-Wunused-value]
unpacker.c:146:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
unpacker.c:158:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
unpacker.c:173:13: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
unpacker.c:183:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
unpacker.c:214:13: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
unpacker.c:249:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
unpacker.c:264:10: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
unpacker.c:267:10: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
unpacker.c: In function âaddr_and_mask_to_svâ:
unpacker.c:92:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
unpacker.c:95:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
unpacker.c:101:11: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
gcc -c  -Iinclude -I/usr/src/linux/include -Wall -DMODULE_PATH=\"/usr/lib/IPTables-IPv4\" -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wl,--as-needed -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -pthread   -DVERSION=\"0.98\" -DXS_VERSION=\"0.98\" -fPIC "-I/usr/lib/perl5/5.16.3/i386-linux-thread-multi/CORE"   maskgen.c
make -C libiptc/ all
make[1]: Entering directory `/root/.local/share/.cpan/build/IPTables-IPv4-0.98-oM4HY7/libiptc'
gcc -o libip4tc.o -c libip4tc.c -I../include -I/usr/src/linux/include -DIPTABLES_VERSION=\"1.2.8\" -O2 -Wall
In file included from libip4tc.c:116:0:
libiptc.c:62:8: error: redefinition of âstruct xt_error_targetâ
In file included from /usr/include/linux/netfilter_ipv4/ip_tables.h:22:0,
                 from ../include/libiptc/libiptc.h:6,
                 from libip4tc.c:29:
/usr/include/linux/netfilter/x_tables.h:69:8: note: originally defined here
In file included from libip4tc.c:116:0:
libiptc.c: In function âiptc_initâ:
libiptc.c:312:10: warning: pointer targets in passing argument 5 of âgetsockoptâ differ in signedness [-Wpointer-sign]
In file included from /usr/include/netinet/in.h:24:0,
                 from /usr/include/netinet/ip.h:24,
                 from ../include/libiptc/ipt_kernel_headers.h:9,
                 from ../include/libiptc/libiptc.h:5,
                 from libip4tc.c:29:
/usr/include/sys/socket.h:220:12: note: expected âsocklen_t * __restrict__â but argument is of type âint *â
In file included from libip4tc.c:116:0:
libiptc.c: In function âtarget_nameâ:
libiptc.c:727:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
libiptc.c: In function âiptc_zero_counterâ:
libiptc.c:1396:16: warning: variable âeâ set but not used [-Wunused-but-set-variable]
libip4tc.c: In function âdump_entryâ:
libip4tc.c:170:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
make[1]: *** [libip4tc.o] Error 1
make[1]: Leaving directory `/root/.local/share/.cpan/build/IPTables-IPv4-0.98-oM4HY7/libiptc'
make: *** [libiptc/libiptc.a] Error 2

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 8th, '13, 19:41
by doktor5000
Only error I can see from your output is this:

In file included from libip4tc.c:116:0:
libiptc.c:62:8: error: redefinition of âstruct xt_error_targetâ
In file included from /usr/include/linux/netfilter_ipv4/ip_tables.h:22:0,
from ../include/libiptc/libiptc.h:6,
from libip4tc.c:29:


That seems like an upstream issue with the source code itself, you may want to rerun make prefixed with LC_ALL=C so you get english error messages and then google for it, maybe you can find a patch for this problem, like here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614439 or here: http://www.spinics.net/lists/netfilter- ... 19649.html

Related, if you want an easy way to generate packages from Perl modules from CPAN, try this: https://wiki.mageia.org/en/Perl_policy#Tools or this http://jquelin.blogspot.de/2011/06/cpan ... ageia.html

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 8th, '13, 19:53
by jiml8
That type of error most commonly occurs due to a versioning problem among the various packages in the system.

Starting with a "make clean" might improve the situation, but more than likely there are some conditional compile statements someplace in the code that are not being properly satisfied due to version differences. I commonly encounter this type of situation when code developed on 32 bit is compiled on 64 bit, or vice-versa; the include files for the two architectures are NOT the same.

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 8th, '13, 20:31
by doktor5000
@Jim: Well, in this specific case i'd say this perl module is just totally outdated and broken, check http://search.cpan.org/~dpates/IPTables-IPv4-0.98/

This Release IPTables-IPv4-0.98 [Download] [Browse] 18 Aug 2003
[...]
CPAN Testers PASS (1) FAIL (96) UNKNOWN (430)


Also the above linked bugreports from distribution rebuilds prove that ;)


Interesting question from my side would be, what do you need this particular module for, and what do you want to achive?

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 8th, '13, 21:32
by jiml8
Yeah, that looks pretty outdated. Hence, versioning problems indeed.

Looks like some dev work will be required to use that package - if it is still needed. Given the age and how IPTables has grown, I don't think that I, personally, would want to bother with it.

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 8th, '13, 21:35
by doktor5000
Patches are also linked above ;)

Yep, even more so when nftables will probably soon be the replacement for iptables when it receives wider adoption.

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 9th, '13, 05:05
by linuxdad
I will open an eLance project to get this to work in the morning. For anyone interested in getting paid for support, let me know, and I will gladly post the Project information on this case.

Thank you.

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 9th, '13, 08:33
by jiml8
*shrug* I live in arizona and I make my living consulting. Where are you?

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 9th, '13, 15:00
by linuxdad
JIm,

I live in Pittsburgh, PA, however I am traveling on Business now in Aruba.

I think that this is really a small project, but I use consultants from time to time to accomplish specific goals.

Nice to meet you.

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 9th, '13, 17:24
by linuxdad
If anyone is interested in assuming this project (getting it to install on Mageia), I am interested in paying someone for their efforts. I have created a project on eLance, or I can work with you directly.

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 9th, '13, 18:11
by doktor5000
doktor5000 wrote:Interesting question from my side would be, what do you need this particular module for, and what do you want to achive?

Maybe it's better to find a more recent drop-in replacement for this module?

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 9th, '13, 19:30
by linuxdad
If there would be a cost-effective drop in replacement, that would be fantastic.

I am using the IPTables::IPV4 module to provide support for the following functions:

$table = IPTables::IPv4::init('filter');

That's it! Is there another function which will provide a view of the IPTables filter?

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 9th, '13, 20:28
by doktor5000
I'm not into perl, but a quick search shows list function for at least: http://search.cpan.org/~jfried/Rex-0.43 ... ptables.pm

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 9th, '13, 22:51
by linuxdad
Thank you, but I think that the tools I am using that talks to the perl Modules needs more functions than this, But I always appreciate input and conversations.

Have a great day, I am working to get these issues closed ASAP.

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 9th, '13, 23:02
by doktor5000
On a related note, there are some patches in the bugreports against this module: https://rt.cpan.org/Public/Dist/Display ... ables-IPv4

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 10th, '13, 19:59
by jiml8
That's it! Is there another function which will provide a view of the IPTables filter?


Well, you could use the perl system() function to directly access iptables via the shell functions.

For example:

Code: Select all
system("iptables -t nat -L");


which would list the ruleset that applies to the nat table.

Re: attempting to install perl module IPTables::IPV4

PostPosted: Dec 10th, '13, 23:19
by linuxdad
As i examine the code that requires the IPTables function, There is much more than just the review of the existing IPTables functions.

Thank you very much for the response.