xl2tpd: unconditionally configure daemon with nodefaultroute and usepeerdns (#12580)

Since the switch to netifd, proto handlers may always set the defaultroute
and provide dns server addresses, netifd will decide in the generic code
path whether the announced values are masked or not.

Additionally protocol handlers should not modify the routing tables themselves
and prevent any launched services from doing so.

Remove the additional defaultroute and peerdns option handling from the ppp.sh
protocol handler and rely on netifd to mask or not mask the values.

git-svn-id: svn://svn.openwrt.org/openwrt/packages@34537 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2012-12-06 18:17:41 +00:00
parent e73c3a92e0
commit 1196915928

View File

@ -13,8 +13,6 @@ proto_l2tp_init_config() {
proto_config_add_string "password"
proto_config_add_string "keepalive"
proto_config_add_string "pppd_options"
proto_config_add_boolean "defaultroute"
proto_config_add_boolean "peerdns"
proto_config_add_boolean "ipv6"
proto_config_add_int "mtu"
proto_config_add_string "server"
@ -45,14 +43,8 @@ proto_l2tp_setup() {
/etc/init.d/xl2tpd start
fi
json_get_vars ipv6 peerdns defaultroute demand keepalive username password pppd_options
json_get_vars ipv6 demand keepalive username password pppd_options
[ "$ipv6" = 1 ] || ipv6=""
[ "$peerdns" = 0 ] && peerdns="" || peerdns="1"
if [ "$defaultroute" = 1 ]; then
defaultroute="defaultroute replacedefaultroute";
else
defaultroute="nodefaultroute"
fi
if [ "${demand:-0}" -gt 0 ]; then
demand="precompiled-active-filter /etc/ppp/filter demand idle $demand"
else
@ -67,8 +59,8 @@ proto_l2tp_setup() {
mkdir -p /tmp/l2tp
echo "${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}}" > "${optfile}"
echo "${peerdns:+usepeerdns}" >> "${optfile}"
echo "$defaultroute" >> "${optfile}"
echo "usepeerdns" >> "${optfile}"
echo "nodefaultroute" >> "${optfile}"
echo "${username:+user \"$username\" password \"$password\"}" >> "${optfile}"
echo "ipparam \"$config\"" >> "${optfile}"
echo "ifname \"l2tp-$config\"" >> "${optfile}"