Header Shadow Image


DD-WRT: Missing 5Ghz settings and kern.warn kernel: wl driver 7.14.164.18 (r692288) failed with code 1

If the Wireless setup page is missing the 5GHz or any GHz settings, or other pages are missing this info:it could be a sign of exhausted nvram.  A clue to this is when resetting the nvram to defaults, all options become available again.  But what about this message?

kern.warn kernel: wl driver 7.14.164.18 (r692288) failed with code 1

The above was really a red herring.  The module can be checke using:

# lsmod|grep -Ei wl
wl                   4420666  0

And if not loaded, use rmmod wl then modprobe wl to re add the module.  These pop up and look like they could be related but they are not, in reality connected to the Wireless page not showing settings.  This is also interesting since these settings don't show up even with plenty of NVRAM left.  Hmm:

# nvram show >/dev/null
size: 68727 bytes (62345 left)

The culprit for the 5Ghz was too many F/W rules in DD-WRT causing (apparent) nvram exhaustion.  To fix this, relocate the iptables rules to /jffs where there's plenty of storage:

To save nvram space, encode the F/W commands as follows (First command below compresses directly from the current F/W settings):

# nvram set pH_fw="$(nvram get rc_firewall | gzip | uuencode -m /dev/stdout)"

# nvram set rc_firewall="nvram get pH_fw | uudecode -o /tmp/pH_fw.gz;gunzip /tmp/pH_fw.gz;chmod +x /tmp/pH_fw;/tmp/pH_fw"

# nvram get pH_fw
begin-base64 644 /dev/stdout
H4sIAAAAAAAAA9VabXeiRhT+vr/inqbnbHJORBgxoh/aYwzZuFVC1WTbTz1E
JkqjQAE3zuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuumb7AwLId
k0Jf/+jjtQxjyw2MpwX1odaFvqY/TKDmgyIKSlNQZEGsEwI1F4KpC7U/YeHM
.
.
.
tUsYOsv6sssssssssssssssssssssssssssssssssssssssssssTUbMPl9Nh
xTHyY5gcggggggggggggggggggggggggggggggggggggggg+2NcYRZ4RnwDl
F/L7XKtQKbbbbbbbbbbbbbbbbbbbbbbbbbbbbbQrPhhhhhhhhhhJc5MVx+S3
xdpjWoFIzzzzzzzzzzzzzzzzzzzzzzkkkkkkkkzzhBDu2+ddVF7b51S2lciU
Gb50hBMJ/YPkKgb/h38AsEVI4rQ2AAA=
====

The command that will show in the UI is:

# nvram get pH_fw | uudecode -o /tmp/pH_fw.gz;gunzip /tmp/pH_fw.gz;chmod +x /tmp/pH_fw;/tmp/pH_fw

To edit the rules use:

# nvram get pH_fw|uudecode | gunzip | tee -a $(nvram get router_name)-firewall.conf

Edit the F/W rules conf file:

# vi $(nvram get router_name)-firewall.conf

Then compress once more:

# nvram set pH_fw="$(cat $(nvram get router_name)-firewall.conf | gzip | uuencode -m /dev/stdout)"

And verify:

# nvram get pH_fw

Verify in the UI that the .rc_firewall command has the compress line above.  An alternative to the above, is to always compress the firewall from a file stored on /jffs.  This will allow for far more storage available to firewall rules.  Create a file on the /jffs/firewall folder or another folder, perhaps on your USB:

# vi /jffs/firewall/$(nvram get router_name)-firewall.run

Copy in or enter the firewall rules.  Once done, set the rc_firewall nvram setting to:

# nvram set rc_firewall="time /bin/sh /jffs/firewall/$(nvram get router_name)-firewall.run"

Verify:

# nvram get rc_firewall
# time /bin/sh /jffs/firewall/$(nvram get router_name)-firewall.run

UI verification:

https://i1.wp.com/www.microdevsys.com/WordPressImages/DD-WRT-Firewall-Rules-In-Jffs.png?ssl=1

ISSUE

Some symptoms of low nvram are messages such as these:

dd-wrt-heimdall.the.abyss.log-20220607.gz:–
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: 2231 total pagecache pages
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: 0 pages in swap cache
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: Swap cache stats: add 0, delete 0, find 0/0
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: Free swap  = 0kB
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: Total swap = 0kB
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: 131072 pages RAM
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: 98304 pages HighMem/MovableOnly
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: 2645 pages reserved
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [  668]     0   668      195       39       4       0        0             0 hotplug2
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [  672]     0   672      206       64       3       0        0             0 mstpd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [  676]     0   676      245      139       3       0        0             0 irqbalance
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [  736]     0   736      394      202       3       0        0             0 watchdog
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 1060]     0  1060      363      194       3       0        0             0 syslogd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 1062]     0  1062      363      170       4       0        0             0 klogd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 1071]     0  1071      187       13       3       0        0             0 p910nd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 1122]     0  1122      307       59       3       0        0             0 dropbear
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 1501]     0  1501      424      114       5       0        0             0 ttraff
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 1650]     0  1650      321       41       3       0        0             0 dhcp6c
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 1676]     0  1676      367      191       4       0        0             0 watchquagga
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 1678]     0  1678      379      110       4       0        0             0 wland
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 1690]     0  1690      425      171       3       0        0             0 dnsmasq
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 1700]     0  1700      317      173       3       0        0             0 radvd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 1701]     0  1701      317       40       3       0        0             0 radvd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2143]     0  2143      394       70       3       0        0             0 process_monitor
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2146]     0  2146      286      115       4       0        0             0 scc
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2147]     0  2147      363       88       3       0        0             0 udhcpc
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2155]     0  2155      392      223       5       0        0             0 nas
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2156]     0  2156      392      118       3       0        0             0 nas
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2157]     0  2157      392      212       4       0        0             0 nas
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2158]     0  2158      392      117       5       0        0             0 nas
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2164]     0  2164     1140      154       5       0        0             0 httpd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2165]     0  2165      329      141       3       0        0             0 resetbutton
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2265]     0  2265      248       57       4       0        0             0 usbipd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2338]     0  2338      368       72       3       0        0             0 zabbix_agentd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2340]     0  2340      368      219       3       0        0             0 zabbix_agentd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2341]     0  2341      370      207       3       0        0             0 zabbix_agentd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2342]     0  2342      370      108       3       0        0             0 zabbix_agentd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2343]     0  2343      370      207       3       0        0             0 zabbix_agentd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2344]     0  2344      370      109       3       0        0             0 zabbix_agentd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2345]     0  2345      370      108       3       0        0             0 zabbix_agentd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2410]     0  2410      188      104       4       0        0             0 cron
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [ 2461]     0  2461      454      316       3       0        0             0 ripd
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: Out of memory: Kill process 2461 (ripd) score 2 or sacrifice child
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: Killed process 2461 (ripd) total-vm:1816kB, anon-rss:392kB, file-rss:872kB
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: zabbix_agentd invoked oom-killer: gfp_mask=0x26040d0, order=0, oom_score_adj=0
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: zabbix_agentd cpuset=/ mems_allowed=0
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: CPU: 1 PID: 2340 Comm: zabbix_agentd Tainted: P                4.4.302 #5717
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: Hardware name: Northstar Prototype
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: Backtrace:
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [<80012988>] (dump_backtrace) from [<80012c0c>] (show_stack+0x18/0x1c)
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel:  r7:87265388 r6:20000013 r5:00000000 r4:8055e9e4
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [<80012bf4>] (show_stack) from [<80014b84>] (dump_stack+0x94/0xa8)
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel: [<80014af0>] (dump_stack) from [<800140e4>] (dump_header+0x54/0x17c)
dd-wrt-heimdall.the.abyss.log-20220607.gz:Jun  5 14:52:34 dd-wrt-heimdall.the.abyss kernel:  r7:87265388 r6:00000000 r5:8374bbec r4:87265380

 

Cheers,

 

REF: https://wiki.dd-wrt.com/wiki/index.php/Useful_Scripts#Compress_the_Firewall_Script_.28to_reduce_nvram_usage.29 
REF: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327261 


     
  Copyright © 2003 - 2013 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License