diff options
author | Rosy Song <rosysong@rosinson.com> | 2018-10-04 14:46:40 +0800 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2018-10-16 14:31:45 +0200 |
commit | fd09e251e9f5809bf4f323e4fa644f90e275146e (patch) | |
tree | 1c97bcab1c0b77eae835e306de381d0c9c706719 /package/network/services | |
parent | 202ac58ca224032866f16c844cfc63396e2af928 (diff) | |
download | upstream-fd09e251e9f5809bf4f323e4fa644f90e275146e.tar.gz upstream-fd09e251e9f5809bf4f323e4fa644f90e275146e.tar.bz2 upstream-fd09e251e9f5809bf4f323e4fa644f90e275146e.zip |
ppp: don't start ppp with IPv6 support if ipv6 is not supported
Signed-off-by: Rosy Song <rosysong@rosinson.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'package/network/services')
-rw-r--r-- | package/network/services/ppp/Makefile | 2 | ||||
-rwxr-xr-x | package/network/services/ppp/files/ppp.sh | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 9fbee90f12..b1f1f68950 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ppp PKG_VERSION:=2.4.7 -PKG_RELEASE:=13 +PKG_RELEASE:=14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://download.samba.org/pub/ppp/ diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index 99d5e4939f..2d9ca6d284 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -74,7 +74,7 @@ ppp_generic_init_config() { proto_config_add_string pppd_options proto_config_add_string 'connect:file' proto_config_add_string 'disconnect:file' - proto_config_add_string ipv6 + [ -e /proc/sys/net/ipv6 ] && proto_config_add_string ipv6 proto_config_add_boolean authfail proto_config_add_int mtu proto_config_add_string pppname @@ -88,7 +88,10 @@ ppp_generic_setup() { local config="$1"; shift local localip - json_get_vars ipv6 ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns + json_get_vars ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns + + [ ! -e /proc/sys/net/ipv6 ] && ipv6=0 || json_get_var ipv6 ipv6 + if [ "$ipv6" = 0 ]; then ipv6="" elif [ -z "$ipv6" -o "$ipv6" = auto ]; then @@ -148,9 +151,9 @@ ppp_generic_setup() { ${connect:+connect "$connect"} \ ${disconnect:+disconnect "$disconnect"} \ ip-up-script /lib/netifd/ppp-up \ - ipv6-up-script /lib/netifd/ppp6-up \ + ${ipv6:+ipv6-up-script /lib/netifd/ppp6-up} \ ip-down-script /lib/netifd/ppp-down \ - ipv6-down-script /lib/netifd/ppp-down \ + ${ipv6:+ipv6-down-script /lib/netifd/ppp-down} \ ${mtu:+mtu $mtu mru $mtu} \ "$@" $pppd_options } |