Static IP Addresses (DHCP) bug?

If your problem doesn't fall into one of the other categories, report it here.

Moderator: Moderators

Draakon
Posts: 8
Joined: Fri Aug 13, 2010 7:44 am

Static IP Addresses (DHCP) bug?

Post by Draakon »

There seems to be bug with adding Static IP Addresses from web interface. I have added one static lease and this works fine, but now when I tried to add another the "/etc/ethers" file gets corrupted. And the DHCP page doesn't load correctly anymore (screenshot). The source of page contains errors about "/etc/ethers":

Code: Select all

<!--
var dhcpEnabled = true;
var subnet="192.168.13.";
var dhcpSection = getDhcpSection(uciOriginal);
var hostData = new Array();
cat: can't open '/etc/hosts': Invalid argument

var etherData = new Array();
cat: can't open '/etc/ethers': Invalid argument

var leaseData = new Array();
Can't open the /etc/ethers from SSH shell either:
Before adding and applying new static ip:

Code: Select all

root@Hellforge:~# cat /etc/ethers
<my mac here>       192.168.13.13
After adding and applying new static ip:

Code: Select all

root@Hellforge:~# cat /etc/ethers
cat: can't open '/etc/ethers': Invalid argument
After rebooting router the page loads again, but contains only the old lease.

Any ideas how to fix the issue or what kind of additional information should I provide to track down the problem?

Router: WRT54G v2.2
Firmware: gargoyle_1.3.3-wrt54g-squashfs.bin

Eric
Site Admin
Posts: 1443
Joined: Sat Jun 14, 2008 1:14 pm

Re: Static IP Addresses (DHCP) bug?

Post by Eric »

I tried to reproduce this today, but it seems to work just fine for me.

If you try again, do you get the same problem?

Also, has anyone else run into this bug?

Draakon
Posts: 8
Joined: Fri Aug 13, 2010 7:44 am

Re: Static IP Addresses (DHCP) bug?

Post by Draakon »

Eric wrote:If you try again, do you get the same problem?
Yes.

Now I found out that even deleting the old lease will result in corrupted "/etc/ethers". Well.. something seems to be very wrong there.

If there is no other suggestions then I'll try restoring the default configuration and (if that won't help) then reflashing.

User avatar
braveheartleo
Posts: 47
Joined: Sun Dec 13, 2009 9:50 am

Re: Static IP Addresses (DHCP) bug?

Post by braveheartleo »

Removing the possibility of a bad flash address that can cause the corruption of /etc/ethers when modifying the file via webif, can you post the output of this command:

Code: Select all

dmesg |grep mini_fo
This should be done after modifying static leases and confirming that /etc/ethers is corrupted.

Draakon
Posts: 8
Joined: Fri Aug 13, 2010 7:44 am

Re: Static IP Addresses (DHCP) bug?

Post by Draakon »

Oh.. I already reflashed the router (with 1.3.4 now). Well.. there was something amiss for sure as restoring the default settings (from web interface) resulted in error (well.. I forgot to copy it, but it was about invalid settings or settings file) and the web interface got corrupted (couldn't log in anymore: no errors, just log in button didn't do anything - and the template was corrupted: no images etc.). Well.. I flashed router by TFTP with 1.3.4 and now it seems to work. At least for now. I don't know whether it was some anomaly from last flash or the router is starting to die (its pretty old - 5 years?). If the problem shall occur again, I'll post output of the command that braveheartleo suggested.

Thanks.

Draakon
Posts: 8
Joined: Fri Aug 13, 2010 7:44 am

Re: Static IP Addresses (DHCP) bug?

Post by Draakon »

*sighs* the same issue again. Here's the output of suggested command:

Code: Select all

root@OpenWrt:~# dmesg |grep mini_fo
Registering mini_fo version $Id$
mini_fo: using base directory: /
mini_fo: using storage directory: /overlay
mini_fo_setattr: ERROR, invalid state detected [1].
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_unlink: ERROR, invalid state detected.
mini_fo_open: invalid file state detected.
mini_fo_unlink: ERROR, invalid state detected.
mini_fo_open: invalid file state detected.
mini_fo_setattr: ERROR, invalid state detected [1].
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_unlink: ERROR, invalid state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_setattr: ERROR, invalid state detected [1].
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_unlink: ERROR, invalid state detected.
mini_fo_open: invalid file state detected.
mini_fo_setattr: ERROR, invalid state detected [1].
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_unlink: ERROR, invalid state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_setattr: ERROR, invalid state detected [1].
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_unlink: ERROR, invalid state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
mini_fo_open: invalid file state detected.
Memory has started to die?

User avatar
braveheartleo
Posts: 47
Joined: Sun Dec 13, 2009 9:50 am

Re: Static IP Addresses (DHCP) bug?

Post by braveheartleo »

Yep, seems like it.

mini_fo or mini fanout is responsible for not only doing wear-leveling on your flash memory, but also for overlaying your entire linux filesystem so that you're able to modify it like a regular linux box.

The errors suggest that whenever mini_fo tries to commit the changes you asked to the flash, it encounters some difficulties in doing so, thus reports errors in syslog and klog. The errors result in a corrupted file like with /etc/ethers. Apart from file corruption, you will also notice erratic behaviors like restoring default settings won't work or webif display is corrupted.

I'm not familiar with WRTs, but if you or somebody else could reformat the entire flash area with a command in the bootloader of your device, then there might be a chance to reset the flash state and make it work again. Of course if it is already a hardware fault then we can't do much about it, unless if we replace the flash chip with a new one. :)

My router is using a RedBoot bootloader and upon accessing it I can issue the command

Code: Select all

fis init -f
so that it reinitializes (formats) the entire flash and reset its state. Of course this won't erase the bootloader partition and other partitions containing configs on my system because those are protected.

Draakon
Posts: 8
Joined: Fri Aug 13, 2010 7:44 am

Re: Static IP Addresses (DHCP) bug?

Post by Draakon »

Hmm.. I suppose I need JTAG cable to do that on WRT54G?

And well.. replacing memory chip would be bit too much hacking for me ;). I have read about people upgrading their router's RAM, but I think they have bit more experience in this field. Well.. I may be able to solder up JTAG cable, but replacing SMD components need bit different tools and especially steady hand. I think I would melt the whole router up.

User avatar
braveheartleo
Posts: 47
Joined: Sun Dec 13, 2009 9:50 am

Re: Static IP Addresses (DHCP) bug?

Post by braveheartleo »

I really don't know how things go with WRTs. With my router I can easily access the bootloader with a bit of timing via telnet. So I don't need to install JTAG or serial.

Also, I'm familiar with my particular bootloader, which is a modified RedBoot based on DD-WRT's Micro RedBoot. I think your bootloader is called CFE, which is for Broadcom-based SoCs. Mine's an Atheros-based WiSoC.

Maybe the best advice I can give is for you to determine the best command for achieving the intended goal of reformatting the entire flash of your device, without the unintentional consequences like erasing critical parts of your flash system.

This has no guarantee that it will rectify the problem of your device, but it's worth to try. You can also try to reflash the device with a different firmware and see if it will still exhibit erratic behavior. If all else fails, then perhaps it's time to retire the device, or take it for a hardware operation. ;)

Good luck. :)

Draakon
Posts: 8
Joined: Fri Aug 13, 2010 7:44 am

Re: Static IP Addresses (DHCP) bug?

Post by Draakon »

It seems that CFE only allows to load firmware image with tftp during the boot. Well at least I didn't find any information about connecting with telnet nor was I successful myself.

I erased (-e switch) linux device with mtd utility and let it wrote gargoyle image again. Now it seems to be working again (and there are no errors in the message buffer of the kernel), but how long I don't know.


Well.. actually there seems to be one problem: time.sh in web-interface doesn't display correct time-zone after saving (and reloading the page). Instead it always shows "UTC-08:00 Pacific Time". Tho' I think the settings are saved fine as:

Code: Select all

root@Hellforge:~# uci get system.@system[0].timezone
STD-2DST,M3.5.0/2,M10.5.0/2
I think it should be right time-zone for UTC+02:00. Maybe someone could try to reproduce this problem (Gargoyle 1.3.4)?

Post Reply