Jump to content

Detailed analysis of a UPnP bug


OmerMor

Recommended Posts

Hi,

I'm using utorrent 1.7.1 build 3360.

My router is Edimax BR-6204Wg with UPnP enabled.

When configuring utorrent to use UPnP, I get the following messages in the log (verbose mode):

[12:33:34] UPnP: Discovered host: http://192.168.2.1:49152/gatedesc.xml

[12:33:34] UPnP: Discovered new device: http://192.168.2.1:49152/upnp/control/WANIPConn1

[12:33:35] UPnP: Mapped TCP port 11481 -> 192.168.2.136:11481

[12:33:35] UPnP: Getting external IP

[12:33:35] UPnP: Unable to get external port.

I used Wireshark to sniff the UPnP handshake and found that this request returned an error:

REQUEST:

POST /upnp/control/WANIPConn1 HTTP/1.1

HOST: 192.168.2.1:49152

CONTENT-LENGTH: 304

CONTENT-TYPE: text/xml; charset="utf-8"

SOAPACTION: "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1#GetExternalIPAddress"

<?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:GetExternalIPAddress xmlns:u="urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1">

</u:GetExternalIPAddress>

</s:Body>

</s:Envelope>

RESPONSE:

HTTP/1.1 500 Internal Server Error

CONTENT-LENGTH: 413

CONTENT-TYPE: text/xml; charset="utf-8"

DATE: Sat, 21 Jul 2007 09:29:50 GMT

EXT:

SERVER: Linux/2.4.18-MIPS-01.00, UPnP/1.0, Intel SDK for UPnP devices /1.2

<s:Envelope

xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"

s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<s:Body>

<s:Fault>

<faultcode>s:Client</faultcode>

<faultstring>UPnPError</faultstring>

<detail>

<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">

<errorCode>-111</errorCode>

<errorDescription>Invalid Action</errorDescription>

</UPnPError>

</detail>

</s:Fault>

</s:Body>

</s:Envelope>

I used a UPnP Tester tool (from http://noeld.com) and found the following:

The device tree that this tool reports is this:

[uPnp IGD]

[WANDevice]

[WANConnectionDevice]

WANIPConnection

WANCommonInterfaceConfig

Invoking the GetExternalIPAddress on the WANIPConnection device succeeds and returns the ip address correctly.

The WANCommonInterfaceConfig device does not support this method.

However uTorrent tried to invoke the GetExternalIPAddress method on the WANCommonInterfaceConfig for some reason, and I guess that's why it failed.

BTW - utorrent succeffuly mapped it's port in the router, and works ok - I'm just bothered by that error message in the log.

This is the complete handshake btween uTorrent and my router:

WANIPConnection:1#GetGenericPortMappingEntry(0)

returned skype's entry

WANIPConnection:1#GetGenericPortMappingEntry(1)

returned skype's entry

WANIPConnection:1#GetGenericPortMappingEntry(2)

returned SpecifiedArrayIndexInvalid error

WANIPConnection:1#AddPortMapping(

NewRemoteHost = ,

NewExternalPort = 39892,

NewProtocol = TCP,

NewInternalPort = 39892,

NewInternalClient = 192.168.2.136,

NewEnabled = 1,

NewPortMappingDescription = utorrent,

NewLeaseDuration = 0)

returned empty AddPortMappingResponse

WANCommonInterfaceConfig:1#GetExternalIPAddress()

returned Invalid Action error

device raised event: PortMappingNumberOfEntries(3)

I hope this helps,

Omer.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...