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 

SetDefaultConnectionService
Goto page 1, 2  Next
 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Bugs
View previous topic :: View next topic  
Author Message
twear



Joined: 01 Nov 2012
Posts: 80

PostPosted: Tue Jun 04, 2013 8:47 pm    Post subject: SetDefaultConnectionService Reply with quote

In the certification test the send an invalid request:
Code:
<?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:SetDefaultConnectionService xmlns:u="urn:schemas-upnp-org:service:Layer3Forwarding:1"><NewDefaultConnectionService>uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1,INVALID_SERVICE_ID</NewDefaultConnectionService></u:SetDefaultConnectionService></s:Body></s:Envelope>


and MiniUPnPd responds incorrectly with:
Code:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:SetDefaultConnectionServiceResponse xmlns:u="urn:schemas-upnp-org:service:Layer3Forwarding:1"></u:SetDefaultConnectionServiceResponse></s:Body></s:Envelope>


Im not exactly sure what the response should be....
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Wed Jun 05, 2013 9:03 am    Post subject: Reply with quote

I guess it should responds with the error 721 InvalidServiceID
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Wed Jun 05, 2013 9:24 am    Post subject: Reply with quote

please check this patch :
https://github.com/miniupnp/miniupnp/commit/4077b0069de79f969a4119d8fee19edb6702e2df

Thank you for helping me making miniupnpd compliant !
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
twear



Joined: 01 Nov 2012
Posts: 80

PostPosted: Wed Jun 05, 2013 6:12 pm    Post subject: Reply with quote

it's not working.

What are you expecting "service" to be. And why are you comparing it to "SERVICE_ID_WANIPC", shouldn't it be layer3forwarding?
Back to top
View user's profile Send private message
twear



Joined: 01 Nov 2012
Posts: 80

PostPosted: Wed Jun 05, 2013 6:29 pm    Post subject: Reply with quote

is there any easy way to add debug statements in so I can help you out?
Back to top
View user's profile Send private message
twear



Joined: 01 Nov 2012
Posts: 80

PostPosted: Wed Jun 05, 2013 8:50 pm    Post subject: Reply with quote

so it looks like a parsing error to me:
sent -uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1,INVALID_SERVICE_ID

the first value from data is parsed and becomes:
uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1

So it looks like you are actually parsing it to well... ha. but i took a look at the parser and I'm lost in your code, so hopefully you can figure it out
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Wed Jun 05, 2013 11:25 pm    Post subject: Reply with quote

twear wrote:
it's not working.

What are you expecting "service" to be. And why are you comparing it to "SERVICE_ID_WANIPC", shouldn't it be layer3forwarding?

what do you mean it's not working ? it does not respond the error 721 InvalidServiceID ?

The connection service id is not layer3forwarding, but the IPConnection service :
#define SERVICE_ID_WANIPC "urn:upnp-org:serviceId:WANIPConn1"
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/


Last edited by miniupnp on Wed Jun 05, 2013 11:33 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Wed Jun 05, 2013 11:32 pm    Post subject: Reply with quote

twear wrote:
so it looks like a parsing error to me:
sent -uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1,INVALID_SERVICE_ID

the first value from data is parsed and becomes:
uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1

So it looks like you are actually parsing it to well... ha. but i took a look at the parser and I'm lost in your code, so hopefully you can figure it out

Where do you see a parsing error ?
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Wed Jun 05, 2013 11:35 pm    Post subject: Reply with quote

twear wrote:
is there any easy way to add debug statements in so I can help you out?

Code:
syslog(LOG_DEBUG, "blah : %s", string);

_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
twear



Joined: 01 Nov 2012
Posts: 80

PostPosted: Thu Jun 06, 2013 5:02 am    Post subject: Reply with quote

miniupnp wrote:
twear wrote:
so it looks like a parsing error to me:
sent -uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1,INVALID_SERVICE_ID

the first value from data is parsed and becomes:
uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1

So it looks like you are actually parsing it to well... ha. but i took a look at the parser and I'm lost in your code, so hopefully you can figure it out

Where do you see a parsing error ?


so through debugging and everything I got to this point, your other comments were spot on.

But the 721 response is never sent, your code is never hit because the "service" come out to be NULL. I put some prints in it to check. So the parsing error that I was talking about comes down to the fact that when you create "service" from "p" that p didn't have the ",INVALID_SERVICE_ID" in it which results in service being NULL. So my conclusion is there is something wrong with how you are parsing out "p"

hope that helps
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Thu Jun 06, 2013 12:17 pm    Post subject: Reply with quote

twear wrote:

But the 721 response is never sent, your code is never hit because the "service" come out to be NULL.

Please read again the code if service == NULL, the 721 error should be sent :
Code:

} else if(service == NULL || 0 != strcmp(service+1, SERVICE_ID_WANIPC)) {
   SoapError(h, 721, "InvalidServiceID");
} else

_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
twear



Joined: 01 Nov 2012
Posts: 80

PostPosted: Thu Jun 06, 2013 5:37 pm    Post subject: Reply with quote

it's always null though, so it's not even passing the other cases
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Thu Jun 06, 2013 8:31 pm    Post subject: Reply with quote

that is strange because the parsing doesn't do anything special...
just before the line
ParseNameValue(h->req_buf + h->req_contentoff, h->req_contentlen, &data);
add :
syslog(LOG_DEBUG, "%.*s", h->req_contentlen, h->req_buf + h->req_contentoff)
So you will see exaclty what is parsed...
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
twear



Joined: 01 Nov 2012
Posts: 80

PostPosted: Thu Jun 06, 2013 8:58 pm    Post subject: Reply with quote

So after skipping the first test case this does succeed on for the invalid test case, but it returns the same response no matter what. 721

I believe that this is due to the value of "p", which is always "uuid:c6c05a33-f704-48df-9910-e099b3471d81:WANConnectionDevice:1" so when you do strchr(p, ',') the return would always be NULL since ',' is never present.

shouldn't p be "uuid:c6c05a33-f704-48df-9910-e099b3471d81:WANConnectionDevice:1,INVALID_SERVICE_ID" in the invalid case?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Thu Jun 06, 2013 9:00 pm    Post subject: Reply with quote

twear wrote:
shouldn't p be "uuid:c6c05a33-f704-48df-9910-e099b3471d81:WANConnectionDevice:1,INVALID_SERVICE_ID" in the invalid case?

Please check the XML string as asked before so we can know if something is wrong with the request, or with the parsing...
_________________
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 -> miniupnpd Bugs All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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.