From 1b2065d0be7f74cb93fac7f208ee4f28666d3f69 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 30 Aug 2018 15:28:19 +0200 Subject: [PATCH] luci-proto-ppp: align keepalive defaults with current OpenWrt Disabling LCP echos by *not* setting "option keepalive" was broken in OpenWrt since https://dev.archive.openwrt.org/ticket/2373.html so setting "0" in LuCI had the effect of reverting back to "5, 1" while the help suggested otherwise. Support for "keepalive 0" was fixed with https://git.openwrt.org/555c59230 so align LuCI now to emit "option keepalive 0" instead of removing the option when entering "0" in the gui. Fixes #2112 Signed-off-by: Jo-Philipp Wich --- .../luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua | 2 +- .../luasrc/model/cbi/admin_network/proto_pppoa.lua | 2 +- .../luasrc/model/cbi/admin_network/proto_pppoe.lua | 2 +- .../luasrc/model/cbi/admin_network/proto_pppossh.lua | 2 +- .../luasrc/model/cbi/admin_network/proto_pptp.lua | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua index 355d9b5b3..5f468bc14 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua @@ -103,7 +103,7 @@ function keepalive_interval.write(self, section, value) if f > 0 then m:set(section, "keepalive", "%d %d" %{ f, i }) else - m:del(section, "keepalive") + m:set(section, "keepalive", "0") end end diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoa.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoa.lua index a5f76a38a..004fd7ef6 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoa.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoa.lua @@ -109,7 +109,7 @@ function keepalive_interval.write(self, section, value) if f > 0 then m:set(section, "keepalive", "%d %d" %{ f, i }) else - m:del(section, "keepalive") + m:set(section, "keepalive", "0") end end diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua index 078b5ffe9..f785b7fb6 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua @@ -103,7 +103,7 @@ function keepalive_interval.write(self, section, value) if f > 0 then m:set(section, "keepalive", "%d %d" %{ f, i }) else - m:del(section, "keepalive") + m:set(section, "keepalive", "0") end end diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppossh.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppossh.lua index eca7bdd4d..e53262b5d 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppossh.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppossh.lua @@ -105,7 +105,7 @@ function keepalive_interval.write(self, section, value) if f > 0 then m:set(section, "keepalive", "%d %d" %{ f, i }) else - m:del(section, "keepalive") + m:set(section, "keepalive", "0") end end diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pptp.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pptp.lua index 462d7019f..6a828efe9 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pptp.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pptp.lua @@ -82,7 +82,7 @@ function keepalive_interval.write(self, section, value) if f > 0 then m:set(section, "keepalive", "%d %d" %{ f, i }) else - m:del(section, "keepalive") + m:set(section, "keepalive", "0") end end -- 2.25.1