Changeset 43143


Ignore:
Timestamp:
2014-11-01T13:37:03+01:00 (3 years ago)
Author:
jow
Message:

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@…>

Location:
trunk/package/network/services/ppp
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/network/services/ppp/Makefile

    r42854 r43143  
    11# 
    2 # Copyright (C) 2006-2012 OpenWrt.org 
     2# Copyright (C) 2006-2014 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1111PKG_NAME:=ppp 
    1212PKG_VERSION:=2.4.7 
    13 PKG_RELEASE:=3 
     13PKG_RELEASE:=4 
    1414 
    1515PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
     
    3030  SECTION:=net 
    3131  CATEGORY:=Network 
    32   MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org> 
    3332  URL:=http://ppp.samba.org/ 
    3433endef 
  • trunk/package/network/services/ppp/files/ppp.sh

    r42860 r43143  
    1313        proto_config_add_string password 
    1414        proto_config_add_string keepalive 
     15        proto_config_add_boolean keepalive_adaptive 
    1516        proto_config_add_int demand 
    1617        proto_config_add_string pppd_options 
     
    2627        local config="$1"; shift 
    2728 
    28         json_get_vars ipv6 demand keepalive username password pppd_options pppname 
     29        json_get_vars ipv6 demand keepalive keepalive_adaptive username password pppd_options pppname 
    2930        if [ "$ipv6" = 0 ]; then 
    3031                ipv6="" 
     
    3940                demand="persist" 
    4041        fi 
    41         [ "${keepalive:-0}" -lt 1 ] && keepalive="" 
    4242        [ -n "$mtu" ] || json_get_var mtu mtu 
    4343        [ -n "$pppname" ] || pppname="${proto:-ppp}-$config" 
    4444 
    45         local interval="${keepalive##*[, ]}" 
    46         [ "$interval" != "$keepalive" ] || interval=5 
     45        local lcp_failure="${keepalive%%[, ]*}" 
     46        local lcp_interval="${keepalive##*[, ]}" 
     47        local lcp_adaptive="lcp-echo-adaptive" 
     48        [ "${lcp_failure:-0}" -lt 1 ] && lcp_failure="" 
     49        [ "$lcp_interval" != "$keepalive" ] || lcp_interval=5 
     50        [ "${keepalive_adaptive:-1}" -lt 1 ] && lcp_adaptive="" 
    4751        [ -n "$connect" ] || json_get_var connect connect 
    4852        [ -n "$disconnect" ] || json_get_var disconnect disconnect 
     
    5155                nodetach ipparam "$config" \ 
    5256                ifname "$pppname" \ 
    53                 ${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}} \ 
     57                ${lcp_failure:+lcp-echo-interval $lcp_interval lcp-echo-failure $lcp_failure $lcp_adaptive} \ 
    5458                ${ipv6:++ipv6} \ 
    5559                nodefaultroute \ 
  • trunk/package/network/services/ppp/patches/207-lcp_mtu_max.patch

    r41193 r43143  
    99--- a/pppd/lcp.c 
    1010+++ b/pppd/lcp.c 
    11 @@ -1914,12 +1914,12 @@ lcp_up(f) 
     11@@ -1917,12 +1917,12 @@ lcp_up(f) 
    1212      * the interface MTU is set to the lowest of that, the 
    1313      * MTU we want to use, and our link MRU. 
Note: See TracChangeset for help on using the changeset viewer.