aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorMarcin Jurkowski <marcin1j@gmail.com>2016-10-17 02:39:08 +0200
committerJohn Crispin <john@phrozen.org>2016-10-26 12:37:46 +0200
commit72eb2b8e22b92839b2e5bb0db86eb8be27790a72 (patch)
treeb620b3009f3f11db9bfe42fb30a00339b4e027b3 /package
parentc560d25d19bd5a9412a4672cacf2a9f2ed601897 (diff)
downloadupstream-72eb2b8e22b92839b2e5bb0db86eb8be27790a72.tar.gz
upstream-72eb2b8e22b92839b2e5bb0db86eb8be27790a72.tar.bz2
upstream-72eb2b8e22b92839b2e5bb0db86eb8be27790a72.zip
comgt: add metric, defaultroute and peerdns options for directip protocol
Adds generic network options for directip protocol dynamic interfaces as suggested by Felix in https://lists.openwrt.org/pipermail/openwrt-devel/2016-February/039794.html. This depends on netifd patch https://patchwork.ozlabs.org/patch/686820/. Signed-off-by: Marcin Jurkowski <marcin1j@gmail.com>
Diffstat (limited to 'package')
-rw-r--r--package/network/utils/comgt/files/directip.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/package/network/utils/comgt/files/directip.sh b/package/network/utils/comgt/files/directip.sh
index d82805278c..79b8c32c83 100644
--- a/package/network/utils/comgt/files/directip.sh
+++ b/package/network/utils/comgt/files/directip.sh
@@ -15,14 +15,15 @@ proto_directip_init_config() {
proto_config_add_string "auth"
proto_config_add_string "username"
proto_config_add_string "password"
+ proto_config_add_defaults
}
proto_directip_setup() {
local interface="$1"
local chat devpath devname
- local device apn pincode ifname auth username password
- json_get_vars device apn pincode auth username password
+ local device apn pincode ifname auth username password $PROTO_DEFAULT_OPTIONS
+ json_get_vars device apn pincode auth username password $PROTO_DEFAULT_OPTIONS
[ -n "$ctl_device" ] && device=$ctl_device
@@ -80,6 +81,7 @@ proto_directip_setup() {
json_add_string name "${interface}_4"
json_add_string ifname "@$interface"
json_add_string proto "dhcp"
+ proto_add_dynamic_defaults
ubus call network add_dynamic "$(json_dump)"
json_init
@@ -87,6 +89,7 @@ proto_directip_setup() {
json_add_string ifname "@$interface"
json_add_string proto "dhcpv6"
json_add_string extendprefix 1
+ proto_add_dynamic_defaults
ubus call network add_dynamic "$(json_dump)"
return 0