ERR_FAIL_COND_V(port_internal<0||port_internal>65535,UPNP::UPNP_RESULT_INVALID_PORT);// Needs to allow 0 because 0 signifies "use external port as internal port"
ERR_FAIL_COND_V_MSG(!is_valid_gateway(),UPNP::UPNP_RESULT_INVALID_GATEWAY,"The Internet Gateway Device must be valid.");
ERR_FAIL_COND_V_MSG(port<1||port>65535,UPNP::UPNP_RESULT_INVALID_PORT,"The port number must be set between 1 and 65535 (inclusive).");
ERR_FAIL_COND_V_MSG(port_internal<0||port_internal>65535,UPNP::UPNP_RESULT_INVALID_PORT,"The port number must be set between 0 and 65535 (inclusive).");// Needs to allow 0 because 0 signifies "use external port as internal port"
ERR_FAIL_COND_V_MSG(proto!="UDP"&&proto!="TCP",UPNP::UPNP_RESULT_INVALID_PROTOCOL,"The protocol must be either TCP or UDP.");
ERR_FAIL_COND_V_MSG(duration<0,UPNP::UPNP_RESULT_INVALID_DURATION,"The port mapping's lease duration can't be negative.");
if(port_internal<1){
port_internal=port;
...
...
@@ -70,14 +70,14 @@ int UPNPDevice::add_port_mapping(int port, int port_internal, String desc, Strin
nullptr,// Remote host, always nullptr as IGDs don't support it