ppp: Allow PPTP over a specified interface
authorJohn Crispin <john@openwrt.org>
Sun, 22 Feb 2015 08:29:34 +0000 (08:29 +0000)
committerJohn Crispin <john@openwrt.org>
Sun, 22 Feb 2015 08:29:34 +0000 (08:29 +0000)
In a dual-WAN setup, it's useful to specify an interface over which to
have PPTP.

Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
SVN-Revision: 44507

package/network/services/ppp/files/ppp.sh

index ba3b412316c79cf28cd552650c0865007c2bc8c7..b4a7467bf5c8c09da04d19bf3a837816057621f8 100755 (executable)
@@ -181,6 +181,7 @@ proto_pppoa_teardown() {
 proto_pptp_init_config() {
        ppp_generic_init_config
        proto_config_add_string "server"
+       proto_config_add_string "interface"
        available=1
        no_device=1
 }
@@ -189,10 +190,11 @@ proto_pptp_setup() {
        local config="$1"
        local iface="$2"
 
-       local ip serv_addr server
-       json_get_var server server && {
+       local ip serv_addr server interface
+       json_get_vars interface server
+       [ -n "$server" ] && {
                for ip in $(resolveip -t 5 "$server"); do
-                       ( proto_add_host_dependency "$config" "$ip" )
+                       ( proto_add_host_dependency "$config" "$ip" $interface )
                        serv_addr=1
                done
        }