diff --git a/lib/net/upnp.js b/lib/net/upnp.js index 2c8a2897..c1357b04 100644 --- a/lib/net/upnp.js +++ b/lib/net/upnp.js @@ -505,11 +505,12 @@ UPNPService.prototype.getExternalIP = co(function* () { /** * Attempt to add port mapping to local IP. * @param {String} remote - Remote IP. - * @param {Number} port - Local and remote port. + * @param {Number} src - Remote port. + * @param {Number} dest - Local port. * @returns {Promise} */ -UPNPService.prototype.addPortMapping = co(function* (remote, port) { +UPNPService.prototype.addPortMapping = co(function* (remote, src, dest) { var action = 'AddPortMapping'; var local = UPNP.getLocalIP(); var xml, child; @@ -519,10 +520,10 @@ UPNPService.prototype.addPortMapping = co(function* (remote, port) { xml = yield this.soapRequest(action, [ ['NewRemoteHost', remote], - ['NewExternalPort', port], + ['NewExternalPort', src], ['NewProtocol', 'TCP'], ['NewInternalClient', local], - ['NewInternalPort', port], + ['NewInternalPort', dest], ['NewEnabled', 'True'], ['NewPortMappingDescription', 'upnp:bcoin'], ['NewLeaseDuration', 0] @@ -539,7 +540,7 @@ UPNPService.prototype.addPortMapping = co(function* (remote, port) { /** * Attempt to remove port mapping from local IP. * @param {String} remote - Remote IP. - * @param {Number} port - Local and remote port. + * @param {Number} port - Remote port. * @returns {Promise} */