[OpenWrt-Devel] [PATCH] lantiq: bugfix uninitialized variables

Florian Eckert eckert.florian at googlemail.com
Fri Sep 25 06:51:26 EDT 2015


Signed-off-by: Florian Eckert <Eckert.Florian at googlemail.com>
Reported-by: Sylwester Petela <sscapi at gmail.com>
---

If you are in the luci overview page and the dsl is not in showtime state
and the variables are not initialized we get messages in log and luci brakes
> Thu Sep 17 15:40:16 2015 daemon.err uhttpd[1110]: expr: syntax error
> Thu Sep 17 15:40:16 2015 daemon.err uhttpd[1110]: expr: syntax error
> Thu Sep 17 15:40:16 2015 daemon.err uhttpd[1110]: expr: syntax error
> Thu Sep 17 15:40:16 2015 daemon.err uhttpd[1110]: expr: syntax error
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]:
> /usr/lib/lua/luci/dispatcher.lua:433: Failed to execute function dispatcher
> target for entry '/'.
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]: The called action
> terminated with an exception:
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]:
> /usr/lib/lua/luci/dispatcher.lua:433: Failed to execute firstchild
> dispatcher target for entry '/admin'.
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]: The called action
> terminated with an exception:
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]:
> /usr/lib/lua/luci/dispatcher.lua:433: Failed to execute function dispatcher
> target for entry '/admin/status'.
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]: The called action
> terminated with an exception:
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]:
> /usr/lib/lua/luci/dispatcher.lua:433: Failed to execute template dispatcher
> target for entry '/admin/status/overview'.
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]: The called action
> terminated with an exception:
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]:
> /usr/lib/lua/luci/template.lua:97: Failed to execute template
> 'admin_status/index'.
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]: A runtime error occured:
> [string "/usr/lib/lua/luci/view/admin_status/index.h..."]:85: attempt to
> call local 'dsl_func' (a nil value)
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]: stack traceback:
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]:     [C]: in function
> 'assert'
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]:
> /usr/lib/lua/luci/dispatcher.lua:433: in function 'dispatch'
> Thu Sep 17 15:40:17 2015 daemon.err uhttpd[1110]:
> /usr/lib/lua/luci/dispatcher.lua:168: in function
> </usr/lib/lua/luci/dispatcher.lua:167>

The patch will resolve this issue.

 target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
index 7809d01..8f1d0c2 100755
--- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
+++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh
@@ -524,6 +524,8 @@ line_data() {
 	[ -z "$satnu" ] && satnu=0
 	[ -z "$snrd" ] && snrd=0
 	[ -z "$snru" ] && snru=0
+	[ -z "$actatpd" ] && actatpd=0
+	[ -z "$actatpu" ] && actatpu=0
 
 	latnd=$(dbt $latnd)
 	latnu=$(dbt $latnu)
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list