KyleK
Joined: 21 Sep 2011 Posts: 1
|
Posted: Wed Sep 21, 2011 4:20 pm Post subject: Link error |
|
|
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;
|
|
|