Strange Linksys WRT54GL Bug

Software / Technology 1 Comment »
Linksys WRT54GL Router

A few days ago, I was messing around with the settings on my Linksys WRT54GL router and moved my home network from 192.168.1.1/24 to 192.168.0.1/24. Changing my mind, I immediately moved back.

Some time later (perhaps after a DHCP lease renewal) I was unable to reach the Internet. Everything looked fine — my connection to the router was working, the router’s connection to the DSL model was working — but I could not reach any websites from my PC. I suspected my DSL connection was down and reset my DSL modem, to no avail.

Today I was preparing to call AT&T and plugged my laptop directly into the DSL modem. I fired up a web browser and, to my astonishment, everything worked!

Assuming AT&T had fixed something on their end, I reconnected my router and tried to access the Internet again. No luck. However, I now knew that the problem was with the router and not the DSL modem.

After a few dead ends (such as cloning my laptop’s MAC address), I took a close look at the results of ipconfig /all:

IPv4 Address. . . . . . . . . . . : 192.168.1.109(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DNS Servers . . . . . . . . . . . : 192.168.0.1

For some reason, my router was handing out an incorrect DNS server with its DHCP leases! I reset my router’s settings to the factory defaults, but that didn’t help. Instead, I forced the router to hand out 192.168.1.1 as a DNS server and voila, everything worked.

I suspect that when I moved the router to 192.168.0.1/24 and back I triggered a bug in the WRT54GL firmware where it didn’t update the DNS server correctly.

After I got everything working again, I decided to upgrade the WRT54GL’s firmware to a third-party product: DD-WRT 23 SP2. With the exception of a minor hiccup where I had to manually reset the router’s settings after flashing (something I should have done beforehand), DD-WRT is working flawlessly.

XmlTextWriter Can Produce Invalid XML

C# 1 Comment »

XmlTextWriter is .NET’s class for writing XML in a forward-only streaming manner. It is highly efficient and is the preferred way to generate XML in .NET in most circumstances. I find XmlTextWriter so useful I wrote a partial C++ implementation of it in Implenting IXmlWriter Series.

Unfortunately, XmlTextWriter isn’t quite as strict as it could be. It will let slip some invalid XML such as duplicate attributes, invalid Unicode characters in the range 0×0 to 0×20, and invalid element and attribute names. You can read about XmlTextWriter’s limitations in the article Customized XML Writer Creation.

If these limitations are an issue for you, I suggest following the instructions in “Customized XML Writer Creation” by writing a custom writer that extends the current XmlTextWriter and adds this functionality. This class can be used directly or passed to any functions which are designed to use XmlTextWriter.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in