aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/ppp/files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-11-01 12:37:03 +0000
committerJo-Philipp Wich <jow@openwrt.org>2014-11-01 12:37:03 +0000
commitfe13e6ccbd7bff993e8c2575ce1f578579805b34 (patch)
treec0a1774bf9a3626db690a07be945ba50b7fc263d /package/network/services/ppp/files
parenta60817d7dae8ede0c31b795ed90fb4e916dca87d (diff)
downloadmaster-187ad058-fe13e6ccbd7bff993e8c2575ce1f578579805b34.tar.gz
master-187ad058-fe13e6ccbd7bff993e8c2575ce1f578579805b34.tar.bz2
master-187ad058-fe13e6ccbd7bff993e8c2575ce1f578579805b34.zip
ppp: support adaptive LCP echos
Port Debians adaptive LCP echo patch to pppd, make it configurable with UCI and enable it by default. When adaptive LCP echo is enabled, LCP echo requests are only sent if the link is idle, this avoids the common situation where a congested PPP link (e.g. during torrenting) is falsely detected as disconnected because the LCP replies are not received in time. Also bump the copyright year in the Makefile, remove a redundant maintainer entry and fix the shell processing of the keepalive option when the two- value syntax is used. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43143 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services/ppp/files')
-rwxr-xr-xpackage/network/services/ppp/files/ppp.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh
index 0456fda5d9..28cdb9cbd6 100755
--- a/package/network/services/ppp/files/ppp.sh
+++ b/package/network/services/ppp/files/ppp.sh
@@ -12,6 +12,7 @@ ppp_generic_init_config() {
proto_config_add_string username
proto_config_add_string password
proto_config_add_string keepalive
+ proto_config_add_boolean keepalive_adaptive
proto_config_add_int demand
proto_config_add_string pppd_options
proto_config_add_string 'connect:file'
@@ -25,7 +26,7 @@ ppp_generic_init_config() {
ppp_generic_setup() {
local config="$1"; shift
- json_get_vars ipv6 demand keepalive username password pppd_options pppname
+ json_get_vars ipv6 demand keepalive keepalive_adaptive username password pppd_options pppname
if [ "$ipv6" = 0 ]; then
ipv6=""
elif [ -z "$ipv6" -o "$ipv6" = auto ]; then
@@ -38,19 +39,22 @@ ppp_generic_setup() {
else
demand="persist"
fi
- [ "${keepalive:-0}" -lt 1 ] && keepalive=""
[ -n "$mtu" ] || json_get_var mtu mtu
[ -n "$pppname" ] || pppname="${proto:-ppp}-$config"
- local interval="${keepalive##*[, ]}"
- [ "$interval" != "$keepalive" ] || interval=5
+ local lcp_failure="${keepalive%%[, ]*}"
+ local lcp_interval="${keepalive##*[, ]}"
+ local lcp_adaptive="lcp-echo-adaptive"
+ [ "${lcp_failure:-0}" -lt 1 ] && lcp_failure=""
+ [ "$lcp_interval" != "$keepalive" ] || lcp_interval=5
+ [ "${keepalive_adaptive:-1}" -lt 1 ] && lcp_adaptive=""
[ -n "$connect" ] || json_get_var connect connect
[ -n "$disconnect" ] || json_get_var disconnect disconnect
proto_run_command "$config" /usr/sbin/pppd \
nodetach ipparam "$config" \
ifname "$pppname" \
- ${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}} \
+ ${lcp_failure:+lcp-echo-interval $lcp_interval lcp-echo-failure $lcp_failure $lcp_adaptive} \
${ipv6:++ipv6} \
nodefaultroute \
usepeerdns \