ppp: remove hardcoded lcp-echo-failure, lcp-echo-interval values
authorJo-Philipp Wich <jo@mein.io>
Thu, 30 Aug 2018 13:08:20 +0000 (15:08 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 30 Aug 2018 13:19:45 +0000 (15:19 +0200)
OpenWrt used to ship hardcoded defaults for lcp-echo-failure and
lcp-echo-interval in the non-uci /etc/ppp/options file.

These values break uci support for *disabling* LCP echos through
the use of "option keepalive 0" as either omitting the keepalive
option or setting it to 0 will result in no lcp-echo-* flags
getting passed to the pppd cmdline, causing the pppd process to
revert to the defaults in /etc/ppp/options.

Address this issue by letting the uci "keepalive" option default
to the former hardcoded values "5, 1" and by removing the fixed
lcp-echo-failure and lcp-echo-interval settings from the
/etc/ppp/options files.

Ref: https://github.com/openwrt/luci/issues/2112
Ref: https://dev.archive.openwrt.org/ticket/2373.html
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=854
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1259
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
package/network/services/ppp/files/etc/ppp/options
package/network/services/ppp/files/ppp.sh

index 6b93f7bdb689e9e5caac0405211ade1532f2e5e3..dbb2bdb3e25d1a42cfcdd796ce982a548224bcbc 100644 (file)
@@ -6,5 +6,3 @@ nopcomp
 nocrtscts
 lock
 maxfail 0
-lcp-echo-failure 5
-lcp-echo-interval 1
index 73bc3161cdcb9f67bfd7875895a6230167792231..99d5e4939f0e9cab9599e10d46bb2561a84947d1 100755 (executable)
@@ -120,6 +120,8 @@ ppp_generic_setup() {
                }
        }
 
+       [ -n "$keepalive" ] || keepalive="5 1"
+
        local lcp_failure="${keepalive%%[, ]*}"
        local lcp_interval="${keepalive##*[, ]}"
        local lcp_adaptive="lcp-echo-adaptive"