From 01d257e95fed205edfea33eb57ef3ff14d9c8007 Mon Sep 17 00:00:00 2001 From: Chen Minqiang Date: Wed, 15 May 2024 22:05:23 +0800 Subject: [PATCH] ppp: add delegate option support Ipv6 delegate option is not respected by proto of ppp/pptp/pppoe/pppoa this add support for them. Signed-off-by: Chen Minqiang Link: https://github.com/openwrt/openwrt/pull/15508 Signed-off-by: Hauke Mehrtens --- package/network/services/ppp/Makefile | 2 +- package/network/services/ppp/files/lib/netifd/ppp6-up | 1 + package/network/services/ppp/files/ppp.sh | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 3ed43e9a5a..6d5db5c704 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ppp -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/paulusmack/ppp diff --git a/package/network/services/ppp/files/lib/netifd/ppp6-up b/package/network/services/ppp/files/lib/netifd/ppp6-up index 9355f59678..51339ad3ec 100755 --- a/package/network/services/ppp/files/lib/netifd/ppp6-up +++ b/package/network/services/ppp/files/lib/netifd/ppp6-up @@ -28,6 +28,7 @@ if [ -n "$AUTOIPV6" ]; then [ -n "$IP6TABLE" ] && json_add_string ip6table $IP6TABLE [ -n "$PEERDNS" ] && json_add_boolean peerdns $PEERDNS [ "$NOSOURCEFILTER" = "1" ] && json_add_boolean sourcefilter "0" + [ "$DELEGATE" = "0" ] && json_add_boolean delegate "0" json_close_object ubus call network add_dynamic "$(json_dump)" fi diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index 074c1f12c8..d7c0cdb1ae 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -83,13 +83,14 @@ ppp_generic_init_config() { proto_config_add_int maxfail proto_config_add_int holdoff proto_config_add_boolean sourcefilter + proto_config_add_boolean delegate } ppp_generic_setup() { local config="$1"; shift local localip - json_get_vars ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns sourcefilter + json_get_vars ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns sourcefilter delegate [ ! -e /proc/sys/net/ipv6 ] && ipv6=0 || json_get_var ipv6 ipv6 @@ -135,6 +136,7 @@ ppp_generic_setup() { [ -n "$connect" ] || json_get_var connect connect [ -n "$disconnect" ] || json_get_var disconnect disconnect [ "$sourcefilter" = "0" ] || sourcefilter="" + [ "$delegate" != "0" ] && delegate="" proto_run_command "$config" /usr/sbin/pppd \ nodetach ipparam "$config" \ @@ -146,6 +148,7 @@ ppp_generic_setup() { ${ip6table:+set IP6TABLE=$ip6table} \ ${peerdns:+set PEERDNS=$peerdns} \ ${sourcefilter:+set NOSOURCEFILTER=1} \ + ${delegate:+set DELEGATE=0} \ nodefaultroute \ usepeerdns \ $demand $persist maxfail $maxfail \ -- 2.30.2