Linksys SRW224G4 WebGUI is Broken

Last week I bought a Linksys SRW224G4 switch for my rack. It seemed like a nice piece of kit, and I got it for a good price.

The first part of the setup went well enough, using the telnet interface. As I wanted to get my head around all the options the switch offered, I thought I would try WebView (aka the webgui). The image below shows what I got with Firefox, on Konqueror is worse.

screenshot of broken Linksys SRW224G4 WebGUI

The Linksys helpdesk wasn't very helpful. Most calls weren't returned when promised and the scripts didn't seem to deal with this issue. In the end I was told to use Internet Explorer. I knew it worked with IE6 running under WINE, but that isn't the point. This is a modern piece of network infrastructure - it should work on any browser, especially one which has almost 30% market share in Oceania.

For the last 5 years or so I have used a fair bit of Linksys kit, as I find they build high quality network equipment. Another big plus for Linksys in my book has been their support for FOSS and hacking - especially the WRT54GL and NSLU2. Now I am not so sure.

Instead of just waiting for the ticket to make its way through the internal bureaucracy of Linksys so that eventually a developer investigates the bug, I thought I would lay it all out here for them. So here we go.

The error in the error console is:

Error: tbl.firstChild.firstChild has no properties
Source File: http://192.168.XXX.YYY/js/tabs.js
Line: 24

The code is question is as follows (line 24 is in highlighted:

[...]
function setTabset(ths) {
[...]
var tbl = ths.parentNode.parentNode.parentNode.parentNode;
subLinks = document.getElementsByName("lnk");
for (var i = 0; i < subLinks.length; i++) {
if (subLinks[i] == ths) {
if (subLinks[i].innerHTML == "LogOut") {
var msg = "Are you sure you want to Log Off?";
if (!confirm(msg)) {
return;
}
}
curTd = tbl.firstChild.firstChild.childNodes[tab].style;
[...]

The argument passed to the function above is a HTML element with an id attribute of 'tab_0'. This element exists, it is the "Setup" tab in the screenshot above. Lets walk through the relevant bits of the code.


var tbl = ths.parentNode.parentNode.parentNode.parentNode;

This steps 4 levels up the DOM tree, from the tab_0 element (the whole webgui is rendered using tables). This works fine. Now tbl references a table element with an id of 'Table2'.

Now we skip down to the line which has the error.

curTd = tbl.firstChild.firstChild.childNodes[tab].style;

This attempts to step down 3 levels from the top of the table to one of the tabs and retrieve the style object for that element. Here are the steps

  • tbl - the table itself
  • tbl.firstChild - the first child node of the table - a text node
  • tbl.firstChild.firstChild - a non existent node as the parent is a text node with no children

Why does this work on IE, but not Firefox/Konqueror and other FOSS browsers? I haven't checked for konq, but I know that the gecko engine (used by Firefox, SeaMonkey, IceWeasel etc etc), the DOM parses is whitespace sensitive. Every bit of text (whitespace or otherwise) is considered to be a text node. This is W3C compliant, there is even a bug report for it - see bug #26179 on mozilla's bugzilla.

This is pretty easy to fix, I haven't tested the code below for this case, but something like it usually works.

/*
* Find the first child which is a html element
*/
function findFirstChild(elm) {
if ( !elm.childNodes.length ) {
return;
}
var children = elm.childNodes.length;
for ( var i = 0; i <= children; ++i ) {
if ( elm.childNodes[i].nodeType == 1 ) {
return elm.childNodes[i];
}
}
return;
}
[...]
function setTabset(ths) {
[...]
curTd = findFirstChild(findFirstChild(tbl)).childNodes[tab].style;
[...]

I hope that Linksys sets their QA team on the SRW224G4 firmware with firefox to find the other bugs like this one. Unless Linksys fixes there gecko based browser support rather promptly, I won't be recommending (or using) their products in future.

Special thanks to the Firebug and DOM Inspector extensions which made this so much easier to trace.

Linksys will be emailed a link to this post and my ticket number. I will keep people posted on how things progress.

Written by Dave on 04 Dec 2007

There's IOS under the hood (well, something IOS-ish, at least)!

Marc wrote:

I was grumbling over Linksys non-support of non-IE browsers as well, and casually surfing Google's search result for various search terms from this context, an then I stumbled over this thread in Linksys' own user forums:

http://forums.linksys.com/linksys/board/message?board.id=Switches&thread.id=1473

In case that post should ever be removed, here's the essentials of that post:

- Telnet to the switch & login
- Once you get to the menu, hit ctrl+z, you should now see a ">" (type ? to all available commands from this point on)
- Type lcli, hit enter, and put the user name in again (admin usually)
- now you should see "console#"

Now what! I telnetted to both of my SRW2008 (FW 1.04) instantly, logged in, and "conf", -completion of command words, show commands - it all seems to be there, or at least close enough to find your way around. I'm still exploring "how deep the rabbit-hole goes".

regards

Marc

Added Sun, 2008-03-02 10:09

Marc, you da man

Seth wrote:

Marc, *thank you* for posting this. I purchased a SRW2008P a few months back with the understanding that it would be fully administerable from the command line.

Lo and behold I quickly discovered that the console interface allowed only limited administrative access, and to get full functionality, I would have to use the web interface.

I was only further infuriated when I determined through tedious trial and error that IE was the only supported browser...ack!

I hope to try this hack out tonight and report back.

Added Tue, 2008-03-04 04:22

Can you try and make a

QpoX wrote:

Can you try and make a greasemonkey script, so all can have a fix for Linksys's hell problem.

Mark: THANKS!!! for the hack!

Added Fri, 2008-03-28 12:44

SRW2016; same issues

Vijay wrote:

I just received an SRW2016 and couldn't login to the web interface (firefox). How dumb can these product managers get? I really can't understand how someone can claim to target business users while they supply a switch with consumer characteristics.

I speak to Linksys people every year at Cebit. They're keen on targetting business users, but just how stupid can one get to coerce the application of choice at layer 7 for a layer 2 piece of equipment?

Managing about active 16000 ports, I thought I'd try a couple of Linksys switching products, but it'll take a couple of years before I even start to consider purchasing them again.

But what a pleasent surprise this cli interface is. Now if Linksys would have pointed this out, I may not have been so mad. Instead, Linksys states: "Please wait for a firmware update to allow firefox access".

Targetting business users, selling them a product and then asking the users to wait for an update to effectively use the product (VLAN & Trunking) is asking for civil lawsuits.

Linksys is grossly misrepresnting their products capabilities while misleading their prospective customers. Nice to have the CLI (bust out the 'expect' shell) but I'm back to 3COM.

BTW: I also purchased SLM2008, SLM2005, SD2008 and SD2005. The SD's are obviously unmanaged while the SLM's are managed. However, the SLM's have no command line type of interface (only http) and it doesn't seem you can drop to a shell. On the other hand, the SLM's web interface work fine with Firefox. Moreover, the SLM's Port section allows for Jumbo frames while the SRW2016 (firmware 1.2.2) doesn't include the Jumbo frame option (at least not in the Port section of the HTTP interface). Funnily enough, the Jumbo frame option does become available in the SRW2016's CLI interface !?

I've got a couple of issues to discuss with these people during the next Cebit.

Added Mon, 2008-05-19 03:25

SLM junk

Vijay wrote:

Well, following my gripes with the SRW switches, I now have a broken SLM2008. All part of the same shipment. It seems to have lasted less than 2 weeks.

The power LED is burning, but none of the switch LEDs are burning. Power cycle or reset does nothing. The connected computers have no link, thus no network, thus this is junk.

That leaves me with another SLM2008, an SLM2005 and a couple of SD2005's and SD2008's. I wonder how long these will last?

BTW: Linksys support replied to my issues with the SRW2016. "Just use Internet Explorer" was their bright solution. "Where can I download that for Linux?", I replied. "Just use Opera for Linux", they replied.

This coercion of browser choice doesn't do me any good. I would have to ensure that all clients connecting with the SRW have Opera installed. There's nothing stopping Linksys from generating cross-browser HTML, Javascript and what not.

Strange that they screw themselves for not mentioning the CLI.

In the end, for a company that heavily uses Linux (opensource) on a whole bunch of their products, the fact that Firefox doesn't work with their switch interface is indicative of a disjointed organization. Either they did it intentionally in which case I would avoid Linksys (switching equipment) at all cost, or they just didn't test their interfaces with Firefox in which case I would avoid Linksys (switching equipment) at all cost.

Guess what? From now on, I'm avoiding Linksys switching equipment at all cost.

Added Fri, 2008-05-30 03:27

SOLUTION: Web View with Firefox and Possibly Other Browsers

jffc wrote:

Inspired by your comment, I took a stab at the problem, and posted a solution below:

http://forums.linksys.com/linksys/board/message?board.id=Switches&thread.id=3117

You may want to try it out if you can't live without browsers/platform other than those of M$' :-)

Added Tue, 2008-06-03 04:43

RE: SOLUTION: Web View with Firefox and Possibly Other Browsers

Dave wrote:

The real solution is to get Linksys to fix their broken kit. When I contacted them last month there is still no ETA on a fixed version of the firmware. This is very disappointing. Combine this with the changes made to the WRT600N to prevent the use of 3rd party firmware, it seems that Linksys is becoming less FOSS friendly.

Added Tue, 2008-06-03 09:14

Procedure for IE6 and IE7

Aday wrote:

Procedure for IE6 and IE7
1. Start Registry Editor.
2. Locate the following key in the registry:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
3. On the Edit menu, point to New, click DWORD Value, and then add the following registry values:
Value name: MaxConnectionsPer1_0Server
Value data: 1
Base: Decimal Value Name: MaxConnectionsPerServer
Value data: 1
Base: Decimal
4. Exit Registry Editor.

Procedure for Internet Explorer 8
The maximum number of connection per server should be limited to 1 The only problem is that MSIE 8 stores that setting on a different location compared to MSIE 7 and older versions.
According to this MS article:
http://support.microsoft.com/kb/282402 You have to follow procedure with version 8: =============================================================
1. Start Registry Editor.
2. Locate the following key in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InternetExplorer\MAIN\FeatureControl\FEATURE_MAXCONNECTIONSPERSERVER
3. On the Edit menu, point to New, click DWORD Value, and then add the following registry values:
Value name: iexplore.exe
Value data: 1
Base: Decimal
4. Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InternetExplorer\MAIN\FeatureControl\FEATURE_MAXCONNECTIONSPER1_0SERVER
5. On the Edit menu, point to New, click DWORD Value, and then add the following registry values:
Value name: iexplore.exe
Value data: 1
Base: Decimal

Added Tue, 2010-02-09 05:45

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <div> <blockquote>
  • Lines and paragraphs break automatically.

More information about formatting options