added names to upnp redirects to avoid router confusion (patch from ET)

This commit is contained in:
csoler 2016-06-13 18:08:05 -04:00
parent 972de42864
commit 8b954a240a
2 changed files with 5 additions and 5 deletions

View File

@ -381,14 +381,14 @@ bool upnphandler::start_upnp()
if (!SetRedirectAndTest(&(config -> urls), &(config->data),
in_addr, in_port1, eport1, eprot1,
NULL /*leaseDuration*/, NULL /*description*/,
NULL /*leaseDuration*/, "RetroShare_TCP" /*description*/,
0))
{
upnpState = RS_UPNP_S_TCP_FAILED;
}
else if (!SetRedirectAndTest(&(config -> urls), &(config->data),
in_addr, in_port2, eport2, eprot2,
NULL /*leaseDuration*/, NULL /*description*/,
NULL /*leaseDuration*/, "RetroShare_UDP" /*description*/,
0))
{
upnpState = RS_UPNP_S_UDP_FAILED;

View File

@ -298,7 +298,7 @@ int SetRedirectAndTest(struct UPNPUrls * urls,
// const char * remoteHost,
// const char * leaseDuration);
r = UPNP_AddPortMapping(urls->controlURL, servicetype,
eport, iport, iaddr, NULL, proto, NULL, NULL);
eport, iport, iaddr, description, proto, NULL, NULL);
#else
#if MINIUPNPC_API_VERSION >= -3 //1.0 2009/04/17
/* $Id: upnpcommands.h,v 1.18 2010/06/09 10:59:09 nanard Exp $ */
@ -311,7 +311,7 @@ int SetRedirectAndTest(struct UPNPUrls * urls,
// const char * proto,
// const char * remoteHost);
r = UPNP_AddPortMapping(urls->controlURL, servicetype,
eport, iport, iaddr, NULL, proto, NULL);
eport, iport, iaddr, description, proto, NULL);
#else
#if MINIUPNPC_API_VERSION >= -7//Before 1.0
/* $Id: upnpcommands.h,v 1.14 2008/09/25 18:02:50 nanard Exp $ */
@ -323,7 +323,7 @@ int SetRedirectAndTest(struct UPNPUrls * urls,
// const char * desc,
// const char * proto);
r = UPNP_AddPortMapping(urls->controlURL, servicetype,
eport, iport, iaddr, NULL, proto);
eport, iport, iaddr, description, proto);
#else
#error MINIUPNPC_API_VERSION is not defined. You may define one follow miniupnpc library version
#endif//>=-7