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 

GetExternalIPAddress() Bug in 2.1.20200510

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Bugs
View previous topic :: View next topic  
Author Message
Richard



Joined: 02 Nov 2020
Posts: 1

PostPosted: Mon Nov 02, 2020 10:18 am    Post subject: GetExternalIPAddress() Bug in 2.1.20200510 Reply with quote

Code:

        struct in_addr addr; // <= Initialize with default value
        if(use_ext_ip_addr)
        {
                strncpy(ext_ip_addr, use_ext_ip_addr, INET_ADDRSTRLEN);
                ext_ip_addr[INET_ADDRSTRLEN - 1] = '\0';
                // If I use use_ext_ip_addr, ext_ip_addr will have valid value here
        }
        else if(getifaddr(ext_if_name, ext_ip_addr, INET_ADDRSTRLEN, &addr, NULL) < 0)
        {
                syslog(LOG_ERR, "Failed to get ip address for interface %s",
                        ext_if_name);
                strncpy(ext_ip_addr, "0.0.0.0", INET_ADDRSTRLEN);
        }
         // Since the value of addr_is_reserved() is  'addr ' which is not initialized if I use use_ext_ip_addr, my ext_ip_addr will be overwritten with 0.0.0.0 in below statements
        if (addr_is_reserved(&addr))
                strncpy(ext_ip_addr, "0.0.0.0", INET_ADDRSTRLEN);

        // ....
         // This causes GetExternalIPAddress() always returns "Action Failed"
        // if I use use_ext_ip_addr
        if (strcmp(ext_ip_addr, "0.0.0.0") == 0)
        {
                SoapError(h, 501, "Action Failed");
                return;
        }
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1504

PostPosted: Mon Nov 02, 2020 8:54 pm    Post subject: Reply with quote

It has been fixed 6 month ago : https://github.com/miniupnp/miniupnp/commit/7be0b480227ca86521dbf39a100fc960352163aa

Please always check with the latest sources before reporting a bug.

Thanks

bug report for reference : https://github.com/miniupnp/miniupnp/issues/460
_________________
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 -> miniupnpc Bugs 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.