D-Link DSL-2640B Router doesn't work with upnp-router-control

Bug #804791 reported by Giorgio Vazzana
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
UPnP Router Control
Fix Released
Medium
Unassigned

Bug Description

My D-Link DSL-2640B Router doesn't work with the development branch of upnp-router-control. Here's the console log:

holden@rye:~/src/upnp-router-control$ upnp-router-control --debug
* Initializing GUI...
* Showing GUI...
* Starting UPnP Resource discovery... done
==> Device Available: D-Link DSL-2640B
   Model description: Broadcom single-chip ADSL router
          Model name: BRCM963xx
        Model number: 1.0
               Brand: Broadcom
    Presentation URL: http://192.168.1.1/
                 UPC: (null)
  Unique Device Name: uuid:0000e0b8-20a0-00e0-c0a0-4818000808e0
    Enum services...
      Service: urn:upnp-org:serviceId:Layer3Forwarding:11
         Type: urn:schemas-upnp-org:service:Layer3Forwarding:1
               > GetDefaultConnectionService
               > SetDefaultConnectionService
      ** Getting DefaultConnectionService...
[WW] GetDefaultConnectionService: empty
    Enum sub-devices...
      Sub-Device: urn:schemas-upnp-org:device:WANDevice:1
        Enum services...
          Service: urn:upnp-org:serviceId:WANCommonIFC1
             Type: urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1
                   > GetCommonLinkProperties
                   > GetTotalBytesSent
                   > GetTotalBytesReceived
                   > GetTotalPacketsReceived
                   > GetTotalPacketsSent
Request for WAN link properties... successful
WAN link properties: access_type=DSL, link_status=Up, max_up=288000, max_down=2272000
        Enum sub-devices...
          Sub-Device: urn:schemas-upnp-org:device:WANConnectionDevice:1
            Enum services...
              Service: urn:upnp-org:serviceId:WANPPPConn1
                 Type: urn:schemas-upnp-org:service:WANPPPConnection:1
                       > SetConnectionType
                       > GetConnectionTypeInfo
                       > GetStatusInfo
                       > GetNATRSIPStatus
                       > GetGenericPortMappingEntry
                       > GetSpecificPortMappingEntry
                       > AddPortMapping
                       > DeletePortMapping
                       > GetExternalIPAddress
GetTotalBytesReceived() duration: 1,005094s
GetTotalBytesSent() duration: 1,034454s
GetTotalBytesReceived() duration: 1,003322s
GetTotalBytesSent() duration: 1,036375s
GetTotalBytesReceived() duration: 1,003333s
GetTotalBytesSent() duration: 1,036604s
GetTotalBytesReceived() duration: 1,005961s
GetTotalBytesSent() duration: 1,034188s
GetTotalBytesReceived() duration: 1,003398s
GetTotalBytesSent() duration: 1,035509s
* Destroying GUI...

It cannot read the WAN Status, external IP and opened ports.
Looking at the code, this problem seems to be related to the fact that my router doesn't have a
"urn:schemas-upnp-org:service:WANIPConnection:1" service, but it has got a
"urn:schemas-upnp-org:service:WANPPPConnection:1" service. The attached patch made it work for me.
Here's a console log after patching the program:

holden@rye:~/src/upnp-router-control$ upnp-router-control --debug
* Initializing GUI...
* Showing GUI...
* Starting UPnP Resource discovery... done
==> Device Available: D-Link DSL-2640B
   Model description: Broadcom single-chip ADSL router
          Model name: BRCM963xx
        Model number: 1.0
               Brand: Broadcom
    Presentation URL: http://192.168.1.1/
                 UPC: (null)
  Unique Device Name: uuid:0000e0b8-20a0-00e0-c0a0-4818000808e0
    Enum services...
      Service: urn:upnp-org:serviceId:Layer3Forwarding:11
         Type: urn:schemas-upnp-org:service:Layer3Forwarding:1
               > GetDefaultConnectionService
               > SetDefaultConnectionService
      ** Getting DefaultConnectionService...
[WW] GetDefaultConnectionService: empty
    Enum sub-devices...
      Sub-Device: urn:schemas-upnp-org:device:WANDevice:1
        Enum services...
          Service: urn:upnp-org:serviceId:WANCommonIFC1
             Type: urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1
                   > GetCommonLinkProperties
                   > GetTotalBytesSent
                   > GetTotalBytesReceived
                   > GetTotalPacketsReceived
                   > GetTotalPacketsSent
Request for WAN link properties... successful
WAN link properties: access_type=DSL, link_status=Up, max_up=288000, max_down=2272000
        Enum sub-devices...
          Sub-Device: urn:schemas-upnp-org:device:WANConnectionDevice:1
            Enum services...
              Service: urn:upnp-org:serviceId:WANPPPConn1
                 Type: urn:schemas-upnp-org:service:WANPPPConnection:1
                       > SetConnectionType
                       > GetConnectionTypeInfo
                       > GetStatusInfo
                       > GetNATRSIPStatus
                       > GetGenericPortMappingEntry
                       > GetSpecificPortMappingEntry
                       > AddPortMapping
                       > DeletePortMapping
                       > GetExternalIPAddress
              ** Subscribed to WANPPPConn1 events
Request for external IP address... successful [xx.xx.xx.xx]
Request for connection status info... successful
Connection info: Status: Connected, Uptime: 180861 sec.
Last connection error:
Request for NAT and RSIP availability... successful [RSIP=yes, NAT=yes]
GetTotalBytesReceived() duration: 1,005124s
GetTotalBytesSent() duration: 1,034875s
GetTotalBytesReceived() duration: 1,003427s
GetTotalBytesSent() duration: 1,037157s
GetTotalBytesReceived() duration: 1,003351s
GetTotalBytesSent() duration: 1,037277s
GetTotalBytesReceived() duration: 1,003344s
GetTotalBytesSent() duration: 1,038706s
==> Getting mapped ports list...
 * Transmission at 51413 [enabled]
   ExtPort: 51413 TCP, IntPort: 51413, IntIP: 192.168.1.5, RemoteIP:
GetTotalBytesReceived() duration: 1,084724s
GetTotalBytesSent() duration: 1,034382s
Request for connection status info... successful
Connection info: Status: Connected, Uptime: 180867 sec.
Last connection error:
GetTotalBytesReceived() duration: 1,003342s
GetTotalBytesSent() duration: 1,046706s
Request for external IP address... successful [xx.xx.xx.xx]
GetTotalBytesReceived() duration: 1,003381s
GetTotalBytesSent() duration: 1,047376s
GetTotalBytesReceived() duration: 1,003372s
GetTotalBytesSent() duration: 1,038303s
* Destroying GUI...

Revision history for this message
Giorgio Vazzana (mywing) wrote :
Revision history for this message
Giorgio Vazzana (mywing) wrote :
Revision history for this message
Daniele Napolitano (dnax88) wrote :

Hi, thanks for this bug report. Can you try my patch? Is very similar to yours but I do a further check.

Changed in upnp-router-control:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Giorgio Vazzana (mywing) wrote :

Hello Daniele,

thanks for looking into this issue. I tried your patch but it doesn't solve the problem, it still fails to recognize my router:

holden@rye:~/src/upnp-router-control$ upnp-router-control --debug
* Initializing GUI...
* Showing GUI...
* Starting UPnP Resource discovery... done
==> Device Available: D-Link DSL-2640B
   Model description: Broadcom single-chip ADSL router
          Model name: BRCM963xx
        Model number: 1.0
               Brand: Broadcom
    Presentation URL: http://192.168.1.1/
                 UPC: (null)
  Unique Device Name: uuid:0000e0b8-20a0-00e0-c0a0-4818000808e0
    Enum services...
      Service: urn:upnp-org:serviceId:Layer3Forwarding:11
         Type: urn:schemas-upnp-org:service:Layer3Forwarding:1
               > GetDefaultConnectionService
               > SetDefaultConnectionService
      ** Getting DefaultConnectionService...
[WW] GetDefaultConnectionService: empty
    Enum sub-devices...
      Sub-Device: urn:schemas-upnp-org:device:WANDevice:1
        Enum services...
          Service: urn:upnp-org:serviceId:WANCommonIFC1
             Type: urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1
                   > GetCommonLinkProperties
                   > GetTotalBytesSent
                   > GetTotalBytesReceived
                   > GetTotalPacketsReceived
                   > GetTotalPacketsSent
Request for WAN link properties... successful
WAN link properties: access_type=DSL, link_status=Up, max_up=284000, max_down=2253000
        Enum sub-devices...
          Sub-Device: urn:schemas-upnp-org:device:WANConnectionDevice:1
            Enum services...
              Service: urn:upnp-org:serviceId:WANPPPConn1
                 Type: urn:schemas-upnp-org:service:WANPPPConnection:1
                       > SetConnectionType
                       > GetConnectionTypeInfo
                       > GetStatusInfo
                       > GetNATRSIPStatus
                       > GetGenericPortMappingEntry
                       > GetSpecificPortMappingEntry
                       > AddPortMapping
                       > DeletePortMapping
                       > GetExternalIPAddress
GetTotalBytesReceived() duration: 1,005439s
GetTotalBytesSent() duration: 1,044330s
GetTotalBytesReceived() duration: 1,003763s
GetTotalBytesSent() duration: 1,034698s
GetTotalBytesReceived() duration: 1,003708s
GetTotalBytesSent() duration: 1,035517s
* Destroying GUI...

I gave a quick look at the code, and from what I can see in urc-upnp.c if string_buffer=="" in get_default_connection_service() (line 558) then connect_service is set to NULL (line 577), so connect_service in device_proxy_available_cb() can never be an empty string. The attached patch works ok, was it this what you had in mind?

Revision history for this message
Bernardo Donadio (bcdonadio) wrote :

I also confirms that this affects also DSL-2730B, which is from the same family.

Here's the (useless) stdout:
sorinan@hitchens:~/upnp-router-control$ upnp-router-control --debug
* Initializing GUI...
* Showing GUI...
* Starting UPnP Resource discovery... done
* Destroying GUI...

Attached is the strace.

Revision history for this message
Bernardo Donadio (bcdonadio) wrote :
Download full text (4.7 KiB)

Here's the packet that is sent back to my computer when upnp-router-control query the network:

No. Time Source Destination Protocol Length Info
  10710 775.680644 192.168.1.1 192.168.1.103 SSDP 305 HTTP/1.1 200 OK

Frame 10710: 305 bytes on wire (2440 bits), 305 bytes captured (2440 bits)
    Arrival Time: Jun 17, 2012 22:51:32.061794000 BRT
    Epoch Time: 1339984292.061794000 seconds
    [Time delta from previous captured frame: 0.000707000 seconds]
    [Time delta from previous displayed frame: 0.500752000 seconds]
    [Time since reference or first frame: 775.680644000 seconds]
    Frame Number: 10710
    Frame Length: 305 bytes (2440 bits)
    Capture Length: 305 bytes (2440 bits)
    [Frame is marked: False]
    [Frame is ignored: False]
    [Protocols in frame: eth:ip:udp:http]
    [Coloring Rule Name: HTTP]
    [Coloring Rule String: http || tcp.port == 80]
Ethernet II, Src: D-LinkIn_93:6b:d8 (28:10:7b:93:6b:d8), Dst: Azurewav_a9:75:79 (74:2f:68:a9:75:79)
    Destination: Azurewav_a9:75:79 (74:2f:68:a9:75:79)
        Address: Azurewav_a9:75:79 (74:2f:68:a9:75:79)
        .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
    Source: D-LinkIn_93:6b:d8 (28:10:7b:93:6b:d8)
        Address: D-LinkIn_93:6b:d8 (28:10:7b:93:6b:d8)
        .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
    Type: IP (0x0800)
Internet Protocol Version 4, Src: 192.168.1.1 (192.168.1.1), Dst: 192.168.1.103 (192.168.1.103)
    Version: 4
    Header length: 20 bytes
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
        0000 00.. = Differentiated Services Codepoint: Default (0x00)
        .... ..00 = Explicit Congestion Notification: Not-ECT (Not ECN-Capable Transport) (0x00)
    Total Length: 291
    Identification: 0x0000 (0)
    Flags: 0x02 (Don't Fragment)
        0... .... = Reserved bit: Not set
        .1.. .... = Don't fragment: Set
        ..0. .... = More fragments: Not set
    Fragment offset: 0
    Time to live: 64
    Protocol: UDP (17)
    Header checksum: 0xb611 [correct]
        [Good: True]
        [Bad: False]
    Source: 192.168.1.1 (192.168.1.1)
    Destination: 192.168.1.103 (192.168.1.103)
User Datagram Protocol, Src Port: ssdp (1900), Dst Port: 35074 (35074)
    Source port: ssdp (1900)
    Destination port: 35074 (35074)
    Length: 271
    Checksum: 0xc880 [validation disabled]
        [Good Checksum: False]
        [Bad Checksum: False]
Hypertext Transfer Protocol
    HTTP/1.1 200 OK\r\n
        [Expert Info (Chat/Sequence): HTTP/1.1 200 OK\r\n]
            [Message: HTTP/1.1 200 OK\r\n]
            [Severity level: Chat]
            [Group: Sequence]
        Request Version: HTTP/1.1
        Status Code: 200
        Response Phrase: OK
    Server: Custom/1.0 UPnP/1.0 Proc/Ver\r\n
    EXT:\r\n
    Location: http://192.168.1.1:5431/dyndev/uuid:28107b93-6bd8-d86b-937b-10281093d80000\r\n
    Cache-Contr...

Read more...

Changed in upnp-router-control:
status: Confirmed → Fix Committed
Changed in upnp-router-control:
status: Fix Committed → Fix Released
milestone: none → 0.3.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.