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 1, 2, 3  Next
 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation
View previous topic :: View next topic  
Author Message
SoLoR



Joined: 30 May 2009
Posts: 36

PostPosted: Sun May 15, 2011 10:05 pm    Post subject: Problems compiling miniupnpd on linux Reply with quote

miniupnpd-1.5.20110513 compiles fine, but miniupnpd-1.5.20110515 errors out with:

Code:
cc  -Wall -Os -I/usr/src/linux/include -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143  -c -o miniupnpd.o miniupnpd.c
In file included from /usr/include/asm/sigcontext.h:5:0,
                 from /usr/include/bits/sigcontext.h:28,
                 from /usr/include/signal.h:339,
                 from miniupnpd.c:35:
/usr/src/linux/include/linux/types.h:13:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
cc  -Wall -Os -I/usr/src/linux/include -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes  -DIPTABLES_143  -c -o upnphttp.o upnphttp.c
make: *** No rule to make target `upnpurns.h', needed by `upnpdescgen.o'.  Stop.


OS Gentoo Linux

bug or my fault?


Last edited by SoLoR on Sat Jun 18, 2011 9:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1487

PostPosted: Mon May 16, 2011 9:45 am    Post subject: Reply with quote

The warning is quite strange as it is triggered by #include <signal.h>...

the error is my fault, i forgot to include upnpurns.h in the package Sad
please download miniupnpd-1.5.20110516.tar.gz
_________________
Main miniUPnP author.
http://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: Mon May 16, 2011 10:22 am    Post subject: Reply with quote

miniupnpd-1.5.20110516 works.

miniupnp wrote:
The warning is quite strange as it is triggered by #include <signal.h>...


That warning is probably some gentoo thing beacause i need to include linux sources in CFLAGS if i want to compile it otherwise it fails with missing nf_nat.h. Also to compile it on gentoo i need to add -DIPTABLES_143 in cflags (it doesnt get auto detected) and using lip4tc, also netfilter/iptcrdr.c needs some changes... there are generaly some issues compiling this on gentoo, if you want to fix it upstream for it i can provide patches.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1487

PostPosted: Mon May 16, 2011 10:23 am    Post subject: Reply with quote

SoLoR wrote:
[...]there are generaly some issues compiling this on gentoo, if you want to fix it upstream for it i can provide patches.

Good idea, as long as it doesn't break anything on other linux distributions Sad
_________________
Main miniUPnP author.
http://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: Mon May 16, 2011 11:40 am    Post subject: Reply with quote

Normal miniupnpd (without IGDv2 support) compiles fine, but when i wanted to try new IGDv2 support i get this error:

cc -Wall -Os -I/usr/src/linux/include -DIPTABLES_143 -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes -c -o miniupnpd.o miniupnpd.c
In file included from /usr/include/asm/sigcontext.h:5:0,
from /usr/include/bits/sigcontext.h:28,
from /usr/include/signal.h:339,
from miniupnpd.c:35:
/usr/src/linux/include/linux/types.h:13:2: warning: #warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
cc -Wall -Os -I/usr/src/linux/include -DIPTABLES_143 -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes -c -o upnphttp.o upnphttp.c
cc -Wall -Os -I/usr/src/linux/include -DIPTABLES_143 -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes -c -o upnpdescgen.o upnpdescgen.c
cc -Wall -Os -I/usr/src/linux/include -DIPTABLES_143 -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes -c -o upnpsoap.o upnpsoap.c
upnpsoap.c: In function ‘PinholeVerification’:
upnpsoap.c:1254:28: error: ‘struct upnphttp’ has no member named ‘clientaddr_v6’
upnpsoap.c:1263:6: error: ‘struct upnphttp’ has no member named ‘clientaddr_v6’
make: *** [upnpsoap.o] Error 1


Also here are patches:

patch for path of iptables: http://solor.mihgroup.eu.org/miniupnpd-1.3-iptables_path.diff

patch for Makefile.linux for gentoo: http://solor.mihgroup.eu.org/miniupnpd-1.5-Makefile_fix.diff
That If statement needs to be checked, found it on google, basicaly if it finds /etc/gentoo-release it can assume gentoo distro and use custom CPPFLAGS / lip4tc instead of CFLAGS / liptc

patch for genconfig.sh for gentoo just to add proper OS_URL: http://solor.mihgroup.eu.org/miniupnpd-1.5-genconfig_gentoo.diff

patch for netfilter/iptcrdr.c: http://solor.mihgroup.eu.org/miniupnpd-1.5-iptcrdr.diff
this is also absouluty neccessery if you want to compile it on gentoo. might break other distros.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1487

PostPosted: Wed May 18, 2011 10:33 pm    Post subject: Reply with quote

I included your modifications in that package :
miniupnpd-1.5.20110519.tar.gz

Please tell me if there is still some changes to do
_________________
Main miniUPnP author.
http://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: Wed May 18, 2011 11:09 pm    Post subject: Reply with quote

Thanks... now everything seems to work as it should without local patches.
Back to top
View user's profile Send private message
SoLoR



Joined: 30 May 2009
Posts: 36

PostPosted: Sat Jun 18, 2011 9:10 pm    Post subject: Reply with quote

i wont make new topic.... but build 0618 is not compiling on my gentoo linux router:

Code:
In file included from /usr/src/linux/include/net/netfilter/nf_nat.h:4:0,
                 from netfilter/iptcrdr.c:32:
/usr/src/linux/include/net/netfilter/nf_conntrack_tuple.h: In function ‘__nf_ct_tuple_src_equal’:
/usr/src/linux/include/net/netfilter/nf_conntrack_tuple.h:156:2: warning: implicit declaration of function ‘nf_inet_addr_cmp’
netfilter/iptcrdr.c: In function ‘get_tcp_match’:
netfilter/iptcrdr.c:575:2: warning: implicit declaration of function ‘IPT_ALIGN’
netfilter/iptcrdr.c: In function ‘get_portmappings_in_range’:
netfilter/iptcrdr.c:886:8: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘unsigned int’
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/libip4tc.so   -o miniupnpd
netfilter/iptcrdr.o: In function `get_tcp_match':
iptcrdr.c:(.text+0x139): undefined reference to `IPT_ALIGN'
iptcrdr.c:(.text+0x147): undefined reference to `IPT_ALIGN'
netfilter/iptcrdr.o: In function `get_udp_match':
iptcrdr.c:(.text+0x19f): undefined reference to `IPT_ALIGN'
iptcrdr.c:(.text+0x1ad): undefined reference to `IPT_ALIGN'
netfilter/iptcrdr.o: In function `add_redirect_rule2':
iptcrdr.c:(.text+0x346): undefined reference to `IPT_ALIGN'
netfilter/iptcrdr.o:iptcrdr.c:(.text+0x354): more undefined references to `IPT_ALIGN' follow
collect2: ld returned 1 exit status
make: *** [miniupnpd] Error 1
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1487

PostPosted: Sun Jun 19, 2011 8:55 pm    Post subject: Reply with quote

that is strange because I've not changed anything in the iptables includes...
IPT_ALIGN is defined in libiptc.h
_________________
Main miniUPnP author.
http://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: Sun Jun 19, 2011 9:13 pm    Post subject: Reply with quote

You have a point, sorry to bug you... this seems not to be your fault since i cant rebuild 0528 anymore as well (same error). Need to figure it it whats wrong, i know i at least updated kernel headers and iptables in between....
Back to top
View user's profile Send private message
SoLoR



Joined: 30 May 2009
Posts: 36

PostPosted: Sun Jun 19, 2011 9:27 pm    Post subject: Reply with quote

It seems to be problem with new iptables... it doesnt compile with iptables 1.4.11.1 but it does with old 1.4.10
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1487

PostPosted: Mon Jun 20, 2011 1:50 pm    Post subject: Reply with quote

Ok, I've never tried to copile against iptables 1.4.11.
last version tested is 1.4.10
I'll give a try
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1487

PostPosted: Mon Jun 20, 2011 2:11 pm    Post subject: Reply with quote

Please have a try with iptables-1.4.11.1 and
miniupnpd-1.5.20110620.tar.gz
_________________
Main miniUPnP author.
http://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: Mon Jun 20, 2011 2:18 pm    Post subject: Reply with quote

miniupnpd-1.5.20110620.tar.gz compiles fine with new iptables... thanks!
Back to top
View user's profile Send private message
pva



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

PostPosted: Thu Jun 30, 2011 9:38 am    Post subject: Reply with quote

miniupnp, could you backport patch for iptables 1.4.11.1? Or does there exist sources code repository to be able backport patches manually?

BTW, do I interpret miniupnpd versions correctly?
1.5 - is stable
1.5.YYYYMMDD - are release candidates for 1.6?
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 1, 2, 3  Next
Page 1 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.