luci-proto-ppp: align keepalive defaults with current OpenWrt
authorJo-Philipp Wich <jo@mein.io>
Thu, 30 Aug 2018 13:28:19 +0000 (15:28 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 30 Aug 2018 13:33:26 +0000 (15:33 +0200)
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 <jo@mein.io>
protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua
protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoa.lua
protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua
protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppossh.lua
protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pptp.lua

index 355d9b5b399259d695c8c56db813de0591847103..5f468bc14cb532cd87968f8866d40d2131dbd763 100644 (file)
@@ -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
 
index a5f76a38ad4164d2fc8dfbd7ac63f08c0196773e..004fd7ef670a835d2074f64d285ea31d0bf22575 100644 (file)
@@ -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
 
index 078b5ffe941530f945deaa31bccb0fab7e816b63..f785b7fb6f3a383abb0c160aa5df0b79c5e91e39 100644 (file)
@@ -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
 
index eca7bdd4d331b51b8bfc0ff2add96329bb8618cf..e53262b5dcf2126665876ead1d9435be0c88af9c 100644 (file)
@@ -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
 
index 462d7019f08fe7022aa73e3fce283c29c27b8cdb..6a828efe9655bac007b788449f4b3dabc0d62b31 100644 (file)
@@ -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