miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problems compiling miniupnpd on linux
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation
View previous topic :: View next topic  
Author Message
pva



Joined: 30 Jun 2011
Posts: 2
Location: Moscow, Russia

PostPosted: Fri Jul 29, 2011 9:44 am    Post subject: Reply with quote

Here is discussion that mentions nf_nat.h headers:
http://comments.gmane.org/gmane.comp.security.firewalls.netfilter.devel/36623

It tells why iptables copies that header files into sources. I'm not sure how we should handle this situation thus I've mailed upstream (netfilter-devel) requesting clarifications on this issue.


BTW, it looks like iptables.h is internal and programs should use xtables.h. Here is relevant commit for iptables modules itself:

http://lists.netfilter.org/pipermail/netfilter-cvslog/2008-November/006138.html
Back to top
View user's profile Send private message
GurliGebis



Joined: 16 Apr 2009
Posts: 35

PostPosted: Fri Jul 29, 2011 7:23 pm    Post subject: Reply with quote

I have found a solution.

Could you please include this header, and reference it instead of nf_nat.h ?

https://raw.github.com/ion1/miniupnpd-ubuntu/master/debian/tiny_nf_nat.h

It contains only the needed parts, and work like a charm.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Sat Jul 30, 2011 7:56 am    Post subject: Reply with quote

thank you ! it works well !
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
GurliGebis



Joined: 16 Apr 2009
Posts: 35

PostPosted: Sat Jul 30, 2011 8:09 am    Post subject: Reply with quote

No problem, glad we found a solution.

The entire fix is here, including the iptcrdr.c changes needed : http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-misc/miniupnpd/files/miniupnpd-nf_nat-fix.diff

Are you going to release a fixed version soon? (I suspect other people not using Gentoo will hit this problem too)
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Sat Jul 30, 2011 1:30 pm    Post subject: Reply with quote

miniupnpd-1.6.20110730.tar.gz is compiling fine on my debian 6.0.2 with iptables-dev ! I think that will work as well on gentoo.
Thank you for the good work !
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
SoLoR



Joined: 30 May 2009
Posts: 36

PostPosted: Sat Jul 30, 2011 2:04 pm    Post subject: Reply with quote

miniupnp wrote:
miniupnpd-1.6.20110730.tar.gz is compiling fine on my debian 6.0.2 with iptables-dev ! I think that will work as well on gentoo.
Thank you for the good work !


still no go on gentoo Sad

Code:
mih miniupnpd-1.6.20110730 # make
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o miniupnpd.o miniupnpd.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o upnphttp.o upnphttp.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o upnpdescgen.o upnpdescgen.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o upnpsoap.o upnpsoap.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o upnpreplyparse.o upnpreplyparse.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o minixml.o minixml.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o upnpredirect.o upnpredirect.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o getifaddr.o getifaddr.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o daemonize.o daemonize.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o upnpglobalvars.o upnpglobalvars.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o options.o options.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o upnppermissions.o upnppermissions.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o minissdp.o minissdp.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o natpmp.o natpmp.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o upnpevents.o upnpevents.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o upnputils.o upnputils.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o getconnstatus.o getconnstatus.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o linux/getifstats.o linux/getifstats.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o linux/ifacewatcher.o linux/ifacewatcher.c
cc -DIPTABLES_143 -Wall -Os -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143   -c -o netfilter/iptcrdr.o netfilter/iptcrdr.c
cc   miniupnpd.o upnphttp.o upnpdescgen.o upnpsoap.o upnpreplyparse.o minixml.o upnpredirect.o getifaddr.o daemonize.o upnpglobalvars.o options.o upnppermissions.o minissdp.o natpmp.o upnpevents.o upnputils.o getconnstatus.o linux/getifstats.o linux/ifacewatcher.o netfilter/iptcrdr.o /usr/lib/libiptc.so   -o miniupnpd
netfilter/iptcrdr.o: In function `delete_rule_and_commit':
iptcrdr.c:(.text+0x12): undefined reference to `iptc_delete_num_entry'
iptcrdr.c:(.text+0x28): undefined reference to `iptc_strerror'
iptcrdr.c:(.text+0x3e): undefined reference to `iptc_commit'
iptcrdr.c:(.text+0x54): undefined reference to `iptc_strerror'
iptcrdr.c:(.text+0x79): undefined reference to `iptc_free'
netfilter/iptcrdr.o: In function `iptc_init_verify_and_append':
iptcrdr.c:(.text+0x1d5): undefined reference to `iptc_init'
iptcrdr.c:(.text+0x1ee): undefined reference to `iptc_strerror'
iptcrdr.c:(.text+0x210): undefined reference to `iptc_is_chain'
iptcrdr.c:(.text+0x235): undefined reference to `iptc_free'
iptcrdr.c:(.text+0x248): undefined reference to `iptc_append_entry'
iptcrdr.c:(.text+0x25e): undefined reference to `iptc_strerror'
iptcrdr.c:(.text+0x274): undefined reference to `iptc_commit'
iptcrdr.c:(.text+0x28a): undefined reference to `iptc_strerror'
iptcrdr.c:(.text+0x2a0): undefined reference to `iptc_free'
netfilter/iptcrdr.o: In function `get_redirect_rule':
iptcrdr.c:(.text+0x61f): undefined reference to `iptc_init'
iptcrdr.c:(.text+0x63a): undefined reference to `iptc_strerror'
iptcrdr.c:(.text+0x65f): undefined reference to `iptc_is_chain'
iptcrdr.c:(.text+0x690): undefined reference to `iptc_first_rule'
iptcrdr.c:(.text+0x754): undefined reference to `iptc_next_rule'
iptcrdr.c:(.text+0x771): undefined reference to `iptc_free'
netfilter/iptcrdr.o: In function `get_redirect_rule_by_index':
iptcrdr.c:(.text+0x791): undefined reference to `iptc_init'
iptcrdr.c:(.text+0x7ac): undefined reference to `iptc_strerror'
iptcrdr.c:(.text+0x7d1): undefined reference to `iptc_is_chain'
iptcrdr.c:(.text+0x804): undefined reference to `iptc_first_rule'
iptcrdr.c:(.text+0x8ef): undefined reference to `iptc_next_rule'
iptcrdr.c:(.text+0x90c): undefined reference to `iptc_free'
netfilter/iptcrdr.o: In function `delete_redirect_and_filter_rules':
iptcrdr.c:(.text+0x933): undefined reference to `iptc_init'
iptcrdr.c:(.text+0x94f): undefined reference to `iptc_strerror'
iptcrdr.c:(.text+0x976): undefined reference to `iptc_is_chain'
iptcrdr.c:(.text+0x9a8): undefined reference to `iptc_first_rule'
iptcrdr.c:(.text+0xa0c): undefined reference to `iptc_next_rule'
iptcrdr.c:(.text+0xa2e): undefined reference to `iptc_free'
iptcrdr.c:(.text+0xa54): undefined reference to `iptc_init'
iptcrdr.c:(.text+0xa8a): undefined reference to `iptc_init'
iptcrdr.c:(.text+0xaa6): undefined reference to `iptc_first_rule'
iptcrdr.c:(.text+0xaee): undefined reference to `iptc_next_rule'
netfilter/iptcrdr.o: In function `get_portmappings_in_range':
iptcrdr.c:(.text+0xbd5): undefined reference to `iptc_init'
iptcrdr.c:(.text+0xbee): undefined reference to `iptc_strerror'
iptcrdr.c:(.text+0xc20): undefined reference to `iptc_is_chain'
iptcrdr.c:(.text+0xc5d): undefined reference to `iptc_first_rule'
iptcrdr.c:(.text+0xcdc): undefined reference to `iptc_next_rule'
iptcrdr.c:(.text+0xcf4): undefined reference to `iptc_free'
collect2: ld returned 1 exit status
make: *** [miniupnpd] Error 1


edit: however old Makefile.linux from 1.6 works....
Back to top
View user's profile Send private message
SoLoR



Joined: 30 May 2009
Posts: 36

PostPosted: Sat Jul 30, 2011 3:06 pm    Post subject: Reply with quote

It doesnt work on gentoo because:

Quote:
else # ifdef IPTABLESPATH
# IPTABLESPATH not defined
# the following test has to be verified :
TEST := $(shell test -f /usr/include/xtables.h && grep -q "XTABLES_VERSION_CODE" /usr/include/xtables.h && echo 1)
ifeq ($(TEST), 1)
CFLAGS := $(CFLAGS) -DIPTABLES_143
LIBS = -liptc


sets to liptc where it should be lip4tc.
Back to top
View user's profile Send private message
SoLoR



Joined: 30 May 2009
Posts: 36

PostPosted: Sat Jul 30, 2011 3:20 pm    Post subject: Reply with quote

Here is diff for Makefile.linux that should work on all distros....

http://solor.mihgroup.eu.org/Makefile.linux.diff
Back to top
View user's profile Send private message
GurliGebis



Joined: 16 Apr 2009
Posts: 35

PostPosted: Sat Jul 30, 2011 8:01 pm    Post subject: Reply with quote

SoLoR wrote:
Here is diff for Makefile.linux that should work on all distros....

http://solor.mihgroup.eu.org/Makefile.linux.diff


Thats an option, would allow me to remove the sed from the src_prepare function in the ebuild : http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-misc/miniupnpd/miniupnpd-1.6.ebuild
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Sun Jul 31, 2011 9:30 am    Post subject: Reply with quote

I'm wondering if we should use libip4tc for everyone, at least with recent versions of iptables.
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
GurliGebis



Joined: 16 Apr 2009
Posts: 35

PostPosted: Sun Jul 31, 2011 11:48 am    Post subject: Reply with quote

miniupnp wrote:
I'm wondering if we should use libip4tc for everyone, at least with recent versions of iptables.


That might be a good idea - from what I know, there is no reason to stick to libiptc Smile
Back to top
View user's profile Send private message
binu



Joined: 12 Dec 2008
Posts: 3

PostPosted: Fri Aug 05, 2011 11:04 pm    Post subject: Reply with quote

I get the following errors when I try to compile miniupnpd -1.6 with iptables-1.4.6.
I have tried to trace the definition in iptables but have not been able to find it. Changing iptc_handle_t to iptc_handle does not work.

Quote:

netfilter/iptcrdr.c: In function 'get_redirect_rule':
netfilter/iptcrdr.c:225: error: 'iptc_handle_t' undeclared (first use in this function)
netfilter/iptcrdr.c:225: error: (Each undeclared identifier is reported only once
netfilter/iptcrdr.c:225: error: for each function it appears in.)
netfilter/iptcrdr.c:225: error: expected ';' before 'h'
netfilter/iptcrdr.c:231: error: 'h' undeclared (first use in this function)
netfilter/iptcrdr.c:275: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c:276: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c: In function 'get_redirect_rule_by_index':
netfilter/iptcrdr.c:322: error: 'iptc_handle_t' undeclared (first use in this function)
netfilter/iptcrdr.c:322: error: expected ';' before 'h'
netfilter/iptcrdr.c:328: error: 'h' undeclared (first use in this function)
netfilter/iptcrdr.c:370: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c:371: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c: At top level:
netfilter/iptcrdr.c:404: error: expected declaration specifiers or '...' before 'iptc_handle_t'
netfilter/iptcrdr.c: In function 'delete_rule_and_commit':
netfilter/iptcrdr.c:412: error: 'h' undeclared (first use in this function)
netfilter/iptcrdr.c: In function 'delete_redirect_and_filter_rules':
netfilter/iptcrdr.c:446: error: 'iptc_handle_t' undeclared (first use in this function)
netfilter/iptcrdr.c:446: error: expected ';' before 'h'
netfilter/iptcrdr.c:454: error: 'h' undeclared (first use in this function)
netfilter/iptcrdr.c:501: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c:502: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c:522: error: too many arguments to function 'delete_rule_and_commit'
netfilter/iptcrdr.c:564: error: too many arguments to function 'delete_rule_and_commit'
netfilter/iptcrdr.c: In function 'get_dnat_target':
netfilter/iptcrdr.c:621: error: invalid application of 'sizeof' to incomplete type 'struct ip_nat_multi_range'
netfilter/iptcrdr.c:627: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c:628: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c:629: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c:629: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c:630: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c:631: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c:631: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c:632: error: dereferencing pointer to incomplete type
netfilter/iptcrdr.c: In function 'iptc_init_verify_and_append':
netfilter/iptcrdr.c:644: error: 'iptc_handle_t' undeclared (first use in this function)
netfilter/iptcrdr.c:644: error: expected ';' before 'h'
netfilter/iptcrdr.c:645: error: 'h' undeclared (first use in this function)
netfilter/iptcrdr.c: In function 'get_portmappings_in_range':
netfilter/iptcrdr.c:828: error: 'iptc_handle_t' undeclared (first use in this function)
netfilter/iptcrdr.c:828: error: expected ';' before 'h'
netfilter/iptcrdr.c:841: error: 'h' undeclared (first use in this function)
make: *** [netfilter/iptcrdr.o] Error 1
ERROR: building miniupnp fail, errno: 2

Is there anyway to work around this ? Thanks in advance for your comments.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Sun Aug 07, 2011 4:52 pm    Post subject: Reply with quote

I'll try to have a look soon...
In the meantime, is IPTABLES_143 defined on the cc command line ?
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
binu



Joined: 12 Dec 2008
Posts: 3

PostPosted: Thu Aug 11, 2011 2:32 pm    Post subject: Reply with quote

I could compile successfully using that compile flag. I was using a custom Makefile and did not notice this flag in the given Makefile. Thanks for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.