[ -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
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
[ -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" \
${ip6table:+set IP6TABLE=$ip6table} \
${peerdns:+set PEERDNS=$peerdns} \
${sourcefilter:+set NOSOURCEFILTER=1} \
+ ${delegate:+set DELEGATE=0} \
nodefaultroute \
usepeerdns \
$demand $persist maxfail $maxfail \