gnuton / asuswrt-merlin.ng

Extends the support of Merlin firmware to more ASUS routers
Other
1.45k stars 82 forks source link

Parental Control - Time scheduling - doesn't get any entry #51

Closed gnuton closed 3 years ago

gnuton commented 3 years ago

Firmware Version Affected 386.00 alpha2

Is this bug present in upstream Merlin releases too? No idea

Describe the bug image

To Reproduce Steps to reproduce the behavior:

  1. Try to add a new entry in time scheduled parental control page
  2. you will get an erro message which tells you cannot have add entries here

Expected behavior You can add entreis

gnuton commented 3 years ago

Issues:

  1. image Max clients is 0.
  2. Addrow_main function gets an upper bound as limit but it's empty. So it will always fail. image

THE PROBLEM seems to be: addrow_main function in the code is always called with 16 as argument but something is changing this to undefined in runtime. CAUSE: Not yet known

gnuton commented 3 years ago

The diff seems not to help

/asuswrt-merlin.ng/release/src/router/www$ colordiff /home/aaloisio/GITonio/ASUSWRT_ORIG/AC68U/asuswrt/release/src/router/www/ParentalControl.asp ParentalControl.asp 
201c201
<   if(based_modelid == "GT-AC5300" || based_modelid == "GT-AC9600" || based_modelid == "RT-AC1200" || based_modelid == "RT-AC1200_V2" || based_modelid == "RT-AC1200GU" || based_modelid == "RT-N19"){
---
>   if(hnd_support || based_modelid == "RT-AC1200" || based_modelid == "RT-AC1200_V2" || based_modelid == "RT-AC1200GU" || based_modelid == "RT-N19"){
949c949
< <body onload="initial();" onunload="unload_body();" onselectstart="return false;" class="bg">
---
> <body onload="initial();" onunload="unload_body();" class="bg">
gnuton commented 3 years ago

Seems like the missing var is MaxRule_parentctrl;

~/GITonio/asuswrt-merlin.ng$ rgrep MaxRule_parentctrl * release/src/router/www/sysdep/FUNCTION/PC_SCHED_V3/ParentalControl.asp: code +='<#ConnectedClient#> (<#List_limit#> '+MaxRule_parentctrl+')'; release/src/router/www/sysdep/FUNCTION/PC_SCHED_V3/ParentalControl.asp: var upper = MaxRule_parentctrl; release/src/router/www/state.js:var MaxRule_parentctrl = isSupport("MaxRule_parentctrl"); Binary file release/src/router/httpd/prebuild/RT-AC86U/web_hook.o matches Binary file release/src/router/httpd/prebuild/GT-AC2900/web_hook.o matches Binary file release/src/router/httpd/prebuild/RT-AC88U/web_hook.o matches Binary file release/src/router/httpd/prebuild/RT-AX56U/web_hook.o matches Binary file release/src/router/httpd/prebuild/RT-AX88U/web_hook.o matches Binary file release/src/router/httpd/prebuild/RT-AX86U/web_hook.o matches Binary file release/src/router/httpd/prebuild/RT-AC5300/web_hook.o matches Binary file release/src/router/httpd/prebuild/RT-AC3100/web_hook.o matches Binary file release/src/router/httpd/prebuild/RT-AC68U/web_hook.o matches Binary file release/src/router/httpd/prebuild/RT-AX58U/web_hook.o matches

gnuton commented 3 years ago

It looks like ParentalControl.asp could be overwritten during build if RTCONFIG_PC_SCHED_V3 is Y ifeq ($(RTCONFIG_PC_SCHED_V3), y) cp $(TOP)/www/sysdep/FUNCTION/PC_SCHED_V3/ParentalControl.asp $(INSTALLDIR)/www/ParentalControl.asp endif

gnuton commented 3 years ago

Checked the build log and indeed it looks like the configuration is not correct. Parental Control Scheduler format version 3 (RTCONFIG_PC_SCHED_V3) [Y/n] y Fix: We wanna switch off RTCONFIG_PC_SCHED_V3 until web_hook.o supports it for DSL-AC68U

gnuton commented 3 years ago

$ rgrep RTCONFIG_PC_SCHED_V3 * release/src-rt-5.02axhnd.675x/hostTools/rtconfig.h:#define RTCONFIG_PC_SCHED_V3 1 release/src-rt/Makefile: sed -i "/RTCONFIG_PC_SCHED_V3>/d" $(1); \ release/src-rt/Makefile: echo "RTCONFIG_PC_SCHED_V3=y" >>$(1); \ release/src/router/www/Makefile:ifeq ($(RTCONFIG_PC_SCHED_V3), y) release/src/router/www/Makefile:ifneq ($(or $(RTCONFIG_WL_SCHED_V2),$(RTCONFIG_PC_SCHED_V3)),y) release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/firewall.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc.c:#endif // #ifdef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc_block.c:#ifndef RTCONFIG_PC_SCHED_V3 release/src/router/rc/pc_block.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/httpd/web.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/httpd/web.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/httpd/web.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/httpd/web.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/shared/sched_v2.c:#if defined(RTCONFIG_WL_SCHED_V3) || defined(RTCONFIG_PC_SCHED_V3) release/src/router/shared/sched_v2.c:#if defined(RTCONFIG_WL_SCHED_V3) || defined(RTCONFIG_PC_SCHED_V3) release/src/router/shared/defaults.c:#ifdef RTCONFIG_PC_SCHED_V3 release/src/router/config/config.in:config RTCONFIG_PC_SCHED_V3 release/src/router/config_base:# RTCONFIG_PC_SCHED_V3 is not set

gnuton commented 3 years ago

It looks enabled because release/src-rt/Makefile if [ "$(PC_SCHED_V3)" != "n" ]; then \ sed -i "/RTCONFIG_PC_SCHED_V2>/d" $(1); \ echo "RTCONFIG_PC_SCHED_V2=y" >>$(1); \ sed -i "/RTCONFIG_PC_SCHED_V3>/d" $(1); \ echo "RTCONFIG_PC_SCHED_V3=y" >>$(1); \ sed -i "/RTCONFIG_SCHED_V2>/d" $(1); \ echo "RTCONFIG_SCHED_V2=y" >>$(1); \ fi; \

gnuton commented 3 years ago

fixed in 386.00 alpha3