View previous topic :: View next topic |
Author |
Message |
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Fri May 10, 2013 8:44 pm Post subject: UPNP_STRICT mode |
|
|
I'm looking at the conformance test for UPnP, and enabling UPNP_STRICT allows for MiniUPnPd to pass the advertising tests, but fails the add/delete/get generic port mapping. When UPNP_STRICT is disabled the opposite occurs.
Would it be better to have a different macro which forces remote hosts to be used, since sending a remote host string is not a requirement of UPnP...? |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1592
|
Posted: Sun May 12, 2013 9:33 pm Post subject: |
|
|
Could you post the detailed error messages about add/delete/get generic port mapping failing when UPNP_STRICT is enabled ??? _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Mon May 13, 2013 4:38 pm Post subject: |
|
|
It fails with 402, Invalid args.
Code: | #ifdef UPNP_STRICT
if(!ext_port || !protocol || !r_host)
#else
if(!ext_port || !protocol)
#endif
{
ClearNameValueList(&data);
SoapError(h, 402, "Invalid Args");
return;
} |
You should not require the r_host when adding/removing since it is not required by specs, at least this is my understanding |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1592
|
Posted: Mon May 13, 2013 5:03 pm Post subject: |
|
|
Quoting UDA (UPnP Device Architecture) 1.1 :
Quote: | Every “in” argument in the definition of the action in the service description MUST be included, in the same order as specified in the service description (SCPD) that is available
from the device. |
and UPnP IGD WanIPConnection 1.0 spec :
Quote: | 2.4.17.DeletePortMapping
This action deletes a previously instantiated port mapping. As each entry is deleted, the array is compacted, and the evented variable PortMappingNumberOfEntries is decremented.
2.4.17.1.Arguments
Argument / Direction / relatedStateVariable
NewRemoteHost / IN / RemoteHost
NewExternalPort / IN / ExternalPort
NewProtocol / IN / PortMappingProtocol |
So NewRemoteHost argument MUST be included for DeletePortMapping.
Maybe it changed in UDA 2.0 ? _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Mon May 13, 2013 5:29 pm Post subject: |
|
|
The wildcard value needs to be supported, which is an empty string. WANIPConnection-v2-Service
Quote: | IGD 2 MUST support both wildcard and specific IP address values for RemoteHost (only the
wildcard value was REQUIRED in release 1.0) |
I ran into this issue when using the UPnP Test Tool, since it sends add/remove/getGeneric port mappings with an empty string, but I believe that due to the check for r_host it fails the corresponding test case. Which doesn't make complete sense to me since even if it was an empty string r_host should be present |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Tue May 14, 2013 5:02 pm Post subject: |
|
|
So I believe that the fix for this would be to remove the added check from UPNP_STRICT, since the r_host can be an empty string. |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1592
|
Posted: Tue May 14, 2013 5:16 pm Post subject: |
|
|
twear wrote: | So I believe that the fix for this would be to remove the added check from UPNP_STRICT, since the r_host can be an empty string. |
As far as I remember this check was added to pass some compliance tests... I have to verify that r_host is not NULL when the <NewRemoteHost> element is there, even if empty. _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Tue May 14, 2013 6:09 pm Post subject: |
|
|
is there a reason why it was added to getGeneric/delete port mapping but not add/addAny? I was also incorrect earlier, add does seem to work when an empty string is given for the remote host. However, the other 2 are still failing.
For getGenericPortMapping and Delete the conformance test is sending <NewRemoteHost></NewRemoteHost>, and UPnP returns <errorCode>402</errorCode>. |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Tue May 14, 2013 6:18 pm Post subject: |
|
|
sorry, not getGeneric, getSpecific |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1592
|
Posted: Tue May 14, 2013 7:24 pm Post subject: |
|
|
twear wrote: | is there a reason why it was added to getGeneric/delete port mapping but not add/addAny? I was also incorrect earlier, add does seem to work when an empty string is given for the remote host. However, the other 2 are still failing.
For getGenericPortMapping and Delete the conformance test is sending <NewRemoteHost></NewRemoteHost>, and UPnP returns <errorCode>402</errorCode>. |
I guess the test suite (I remember it was CDRouter) was only checking GetSpecificPortMapping and DeletePortMapping _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Tue May 14, 2013 8:35 pm Post subject: |
|
|
well I just tested the conformance tests after removing the r_host check, and everything passes fine. |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Tue May 14, 2013 8:49 pm Post subject: |
|
|
I don't think this has anything to do with upnp_strict, but I'm also failing the addPortMapping case due to not sending back the PortMappingNumberOfEntries variable in the notification event. Is this expected?
Thanks for the help |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1592
|
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1592
|
Posted: Tue May 14, 2013 9:21 pm Post subject: |
|
|
twear wrote: | I don't think this has anything to do with upnp_strict, but I'm also failing the addPortMapping case due to not sending back the PortMappingNumberOfEntries variable in the notification event. Is this expected? |
It is not expected, it has to be fixed too... tomorrow _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Tue May 14, 2013 9:57 pm Post subject: |
|
|
that patch worked perfectly, thanks |
|
Back to top |
|
|
|