• April 26, 2024, 09:55:21 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: Versions 1.21 to 1.21b05 broke wake-on-lan.  (Read 9528 times)

Mucaro

  • Level 1 Member
  • *
  • Posts: 3
Versions 1.21 to 1.21b05 broke wake-on-lan.
« on: November 09, 2008, 01:08:57 AM »

Hi everybody.  I'm glad I found this nice forum of yours.  I had been running v1.11 since I bought my DIR-655 and decided to upgrade to the latest firmware in an attempt to get rid of sporadic disconnections I've been experiencing recently.  So I upgraded to v1.21b05 and fell in love with the SharePort feature.  I had been contemplating buying a network printer for some time.  Now, I don't.  :D

But soon I discovered that I could no longer wake up any of the remote LAN computers from my office.  v1.11 allowed me to set a Virtual Server with a destination address ending in 255 that would broadcast the Wake-On-LAN "magic packets" from the WAN to a particular subnet.  Broadcasting to a subnet, as you most probably know, is essential to waking up IP-less sleeping computers.

I tried v1.21b05 and a couple other flavors of v1.21 and none allowed IPs ending in 255.  I was forced to downgrade to v1.20 since I rely on WoL over the internet to maintain my customers' computers up to date.

I inspected the HTML code of the router's Virtual Server page and it seems that the problem is caused by overzealous validation:

--- code starts ---
        /*
         * page_verify()
         */
        function page_verify()
        {
            for (var i = 0; i < vs_table_size; i++) {
                if (mf["vs_enabled_" + i].value == "true") {
                    var vs_name = mf["vs_name_" + i].value;
                    var vs_proto = mf["vs_proto_" + i].value;
                    var vs_private = mf["vs_private_" + i].value;
                    var vs_public = mf["vs_public_" + i].value;
                    var vs_ipaddr = mf["vs_ipaddr_" + i].value;

                    if (!is_ipv4_valid(vs_ipaddr)) {
                        alert("Invalid IP address for virtual server  '" + vs_name + "'.");
                        return 0;
                    }
                   
                    var vs_chk;
                    vs_chk = vs_ipaddr.split('.');
                    if (vs_chk[3] == "0" || vs_chk[3] == "255") {
                        alert("Invalid IP address for virtual server  '" + vs_name + "'.");
                        return 0;
                    }
.
.
.
--- code ends ---

I hope this is an easy fix and I get to enjoy SharePoint soon.

Thanks for a great job overcharging this already excellent router.

Logged

EddieZ

  • Level 10 Member
  • *****
  • Posts: 2494
Re: Versions 1.21 to 1.21b05 broke wake-on-lan.
« Reply #1 on: November 09, 2008, 04:03:56 AM »

Hi Mucaro,
I am not an HTML/scripting expert but I think you got something figured out. How does the code from 1.11/1.20 look like? Does it have the same validation?
Logged
DIR-655 H/W: A2 FW: 1.33

Mucaro

  • Level 1 Member
  • *
  • Posts: 3
Re: Versions 1.21 to 1.21b05 broke wake-on-lan.
« Reply #2 on: November 09, 2008, 12:47:49 PM »

EddieZ,
That's a good question.  I reinstalled v1.11 and v1.20 again and confirmed that their Virtual Server HTML pages do not check the 4th octet of the IP address (vs_chk[3]) for "0" or "255".  That "if" condition simply doesn't exist in the previous versions of the firmware.

By the way, I found a workaround for this problem:
1) Loaded v1.20 again.
2) Configured the Wake-On-LAN Virtual Server (IP Address 192.168.1.255, Public Port 5900, Private Port 7, Protocol UDP).
3) Saved the router configuration to a file (via Tools, System, Save To Local Hard Drive option).
4) Loaded v1.21.
5) Loaded the configuration file saved in step 3.

I basically bypassed the HTML validation.  As a reward for all this work I got SharePort back!  Sweeet...   ;D
Logged

EddieZ

  • Level 10 Member
  • *****
  • Posts: 2494
Re: Versions 1.21 to 1.21b05 broke wake-on-lan.
« Reply #3 on: November 09, 2008, 02:27:40 PM »

Mucaro,
Great analysis and solution!  :-*
Unless you're already on that path there's a future for you in IT (come and join my firm... ;))

Logged
DIR-655 H/W: A2 FW: 1.33

Mucaro

  • Level 1 Member
  • *
  • Posts: 3
Re: Versions 1.21 to 1.21b05 broke wake-on-lan.
« Reply #4 on: November 09, 2008, 02:44:44 PM »

lol Thanks.  Yep, I'm already there.
Logged