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>
This commit is contained in:
Rosy Song 2018-10-04 14:46:40 +08:00 committed by Hans Dedecker
parent 202ac58ca2
commit fd09e251e9
2 changed files with 8 additions and 5 deletions

View file

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

View file

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