View previous topic :: View next topic |
Author |
Message |
livings124
Joined: 08 Dec 2007 Posts: 10
|
Posted: Sat Dec 08, 2007 8:40 pm Post subject: errors with port mapping |
|
|
Hey, I'm the other developer from Transmission. With the recent inclusion I've been getting these two errors logged.
12/8/07 3:38:20 PM [0x0-0x82c82c][50004] Port Mapping (NAT-PMP): initnatpmp returned error -3, errno is 22 (Invalid argument)
12/8/07 3:38:20 PM [0x0-0x82c82c][50004] Port Mapping (NAT-PMP): sendpublicaddressrequest returned error -10, errno is 39 (Destination address required) |
|
Back to top |
|
|
Charles
Joined: 06 Nov 2007 Posts: 20
|
|
Back to top |
|
|
Chinstrap
Joined: 08 Dec 2007 Posts: 6
|
Posted: Sat Dec 08, 2007 9:13 pm Post subject: |
|
|
Hey, I'm nobody, I just pester the Transmission developers. Since gcc on OSX doesn't define BSD, we aren't getting a working implementation of getgateway. I just added the check for __APPLE__ and that seemed to fix it.
---getgateway.c
+++getgateway.c
@@ -17,7 +17,7 @@
#include <ctype.h>
#include <netinet/in.h>
#include <sys/param.h>
-#ifdef BSD
+#if defined(BSD) || defined(__APPLE__)
#include <stdlib.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
@@ -60,7 +60,7 @@
}
#endif
-#ifdef BSD
+#if defined(BSD) || defined(__APPLE__)
#define ROUNDUP(a) \
((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Tue Dec 11, 2007 12:47 am Post subject: |
|
|
thanks for the patch
indeed -3 is the value for NATPMP_ERR_CANNOTGETGATEWAY _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
Charles
Joined: 06 Nov 2007 Posts: 20
|
Posted: Tue Dec 11, 2007 5:38 am Post subject: |
|
|
miniupnp wrote: | thanks for the patch
indeed -3 is the value for NATPMP_ERR_CANNOTGETGATEWAY |
The patch gets things building, but doesn't solve the error. Is there anything you need from the Transmission team, or from Apple testers, to get this working? |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Tue Dec 11, 2007 9:15 am Post subject: |
|
|
Charles wrote: | miniupnp wrote: | thanks for the patch
indeed -3 is the value for NATPMP_ERR_CANNOTGETGATEWAY |
The patch gets things building, but doesn't solve the error. Is there anything you need from the Transmission team, or from Apple testers, to get this working? |
Does the test program testgetgateway build and work ? _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
Charles
Joined: 06 Nov 2007 Posts: 20
|
Posted: Tue Dec 11, 2007 3:14 pm Post subject: |
|
|
miniupnp wrote: | Charles wrote: | miniupnp wrote: | thanks for the patch
indeed -3 is the value for NATPMP_ERR_CANNOTGETGATEWAY |
The patch gets things building, but doesn't solve the error. Is there anything you need from the Transmission team, or from Apple testers, to get this working? |
Does the test program testgetgateway build and work ? |
I don't have a mac so I'm just a messenger here, but here are the results from a mac Airport user:
|
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Wed Dec 12, 2007 3:54 pm Post subject: |
|
|
i'm going to put some specific code for getgateway under Mac OS X _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
Chinstrap
Joined: 08 Dec 2007 Posts: 6
|
Posted: Wed Dec 12, 2007 9:36 pm Post subject: |
|
|
If you want to take a look at http://transmission.m0k.org/trac/browser/branches/0.9x/libtransmission/platform.c
tr_getDefaultRoute() is what we use in Transmission to get the default route. The BSD section works for both BSD and OSX. In fact, I went so far as to take a copy of libnatpmp-20071202 and replace getgateway.c with the getDefaultRoute and supporting functions from platform.c and built and ran the test programs under OSX successfully. |
|
Back to top |
|
|
Charles
Joined: 06 Nov 2007 Posts: 20
|
Posted: Thu Dec 13, 2007 2:08 am Post subject: |
|
|
Chinstrap and I worked on this a bit today and merged Transmission's old mac gateway code with your Linux gateway code, which is much cleaner than ours.
The result is here in Transmission's svn. This merged version of getgateway() is confirmed to work on Linux and OS X and has the same license as libnatpmp, if you want it. |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Thu Dec 13, 2007 2:25 pm Post subject: |
|
|
Charles wrote: | Chinstrap and I worked on this a bit today and merged Transmission's old mac gateway code with your Linux gateway code, which is much cleaner than ours.
The result is here in Transmission's svn. This merged version of getgateway() is confirmed to work on Linux and OS X and has the same license as libnatpmp, if you want it. |
thanks ! _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Thu Dec 13, 2007 5:02 pm Post subject: |
|
|
I have just corrected the mib[] array content
it should work now _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
|