costello
Joined: 25 Aug 2015 Posts: 1
|
Posted: Tue Aug 25, 2015 7:55 pm Post subject: UPNP_GetExternalIPAddress returning wrong address |
|
|
Dear Sirs,
I'm using UPNP_GetExternalIPAddress in ubuntu 14.04 and my code looks like this:
Code: |
int status = UPNP_GetValidIGD(upnp_dev, &upnp_urls, &upnp_data, lan_address, sizeof(lan_address));
// look up possible "status" values, the number "1" indicates a valid IGD was found
QLOG_STR("UPNP_GetValidIGD = " + QString::number(status)) ;
if ( status > 0 ) {
// get the external (WAN) IP address
char wan_address[64] = { 0 } ;
int getExternalError =
UPNP_GetExternalIPAddress(upnp_urls.controlURL, upnp_data.first.servicetype, wan_address);
QLOG_STR("Wan addr: " + QString(wan_address) + " error = " + QString::number(getExternalError)) ;
|
and the address I'm getting to wan_address is not the external IP addr of the router. I'm getting address 100.69.92.82 and that is not the correct one.
Options are that
1. I'm using UPNP_GetExternalIPAddress in wrong way?
2. The router in question is lying about the address (might be old telewell but not sure)
3. UPNP_GetExternalIPAddress as it is packed into ubuntu 14.04 is not fully functional?
Any suggestions?
--
Antti J, Oulu, Finland |
|