xl2tpd: unconditionally configure daemon with nodefaultroute and usepeerdns (#12580)
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 6 Dec 2012 18:17:41 +0000 (18:17 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 6 Dec 2012 18:17:41 +0000 (18:17 +0000)
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.

SVN-Revision: 34537

net/xl2tpd/files/l2tp.sh

index b0d5d4ca69fc9ab9bbe8bf086b554676de68a1b0..867234dbe10f552cfb4699eaa4dfe65ea2ef3e34 100644 (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}"