Joined: 21 Jan 2010
|Posted: Thu Jan 21, 2010 4:20 am Post subject: Unable to get gateway
|I'm looking to use libnatpmp for a configuring NAT, and went to build natpmpc-static.exe on Windows as a test (using the latest release). Just running the program without any arguments to try to obtain the gateway, I got the following result:
initnatpmp() returned 0 (SUCCESS)
sendpublicaddressrequest returned 2 (SUCCESS)
readnatpmpresponseorretry returned -5 (FAILED)
errno=0 'No error'
However, given that I have an old Linksys RT31P2 (from Vonage) which is known to have upnp issues, I figured it was just my router. So I had two of my colleagues try running it, one with a Netgear wpn824 (supported on the config site) and the other with the trusty Linksys WRT-54GL with Tomato firmware. Both had upnp enabled, but got the same result.
I did some digging in the code, and found that the recvfrom on line 178 of natpmp.c was returning an error. As you need to use WSAGetLastError() in Windows to get anything meaningful (errno returns 0), I put that in there and found that I was getting an WSAEWOULDBLOCK. Does this mean that the proper UDP port isn't open?
I'm pretty unfamiliar with natpmp & upnp (I'm not sure exactly how closely, if at all, they're related, or if enabling one usually enables the other), but would like to get this to work soon if possible. Should I be using upnp instead for broader support? If natpmp is the better bet, I'm willing to help troubleshoot and contribute patches if someone could give me some guidance. Let me know if I'll need Wireshark installed for anything (I haven't used it much since it was called Ethereal, but I used to know what I was doing with that at least for TCP, SCTP, and PPP stack debugging ). I know that my router may be a hinderance if it happens to have the upnp bugs I read about (it may or may not, I'm not entirely sure), but am looking to buy a new one anyway (probably something with 802.11n draft 2.0 that is fast).