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 

Link error

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation
View previous topic :: View next topic  
Author Message
KyleK



Joined: 21 Sep 2011
Posts: 1

PostPosted: Wed Sep 21, 2011 4:20 pm    Post subject: Link error Reply with quote

I build Transmission regularly from SVN, which pulls in miniupnp as well.
Transmission links to libminiupnp.a statically.

While miniupnp itself builds just fine, Transmission throws a linker error:

Code:

../third-party/miniupnp/libminiupnp.a(miniupnpc.o): In function `upnpDiscover':
/ffp/users/KyleK/devel/Transmission/2.40b1/third-party/miniupnp/miniupnpc.c:664: undefined reference to `in6addr_any'
collect2: ld returned 1 exit status


in6addr_any is actually defined on my system (an embedded ARM device running Linux 2.6.22.18 and uClibc 0.9.29), but the way it is used in miniupnp is apparently prohibited.

I fixed the issue with this patch:
Code:

Index: miniupnp/miniupnpc.c
===================================================================
--- miniupnp/miniupnpc.c   (revision 12903)
+++ miniupnp/miniupnpc.c   (working copy)
@@ -394,10 +394,11 @@
    memset(&sockudp_r, 0, sizeof(struct sockaddr_storage));
    if(ipv6) {
       struct sockaddr_in6 * p = (struct sockaddr_in6 *)&sockudp_r;
+      struct in6_addr in6addr = IN6ADDR_ANY_INIT;
       p->sin6_family = AF_INET6;
       if(sameport)
          p->sin6_port = htons(PORT);
-      p->sin6_addr = in6addr_any; /* in6addr_any is not available with MinGW32 3.4.2 */
+      p->sin6_addr = in6addr; /* in6addr_any is not available with MinGW32 3.4.2 */
    } else {
       struct sockaddr_in * p = (struct sockaddr_in *)&sockudp_r;
       p->sin_family = AF_INET;

Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1481

PostPosted: Wed Sep 21, 2011 6:51 pm    Post subject: Reply with quote

Thanks. I'll look into this and try to understand what is the good way to do this.
Maybe I'll need to add some #ifdef...
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Compilation/Installation All times are GMT
Page 1 of 1

 
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.