comgt: add metric, defaultroute and peerdns options for ncm protocol
Adds generic network options for ncm protocol dynamic interfaces as suggested by Felix in http://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>
This commit is contained in:
parent
d2606107ab
commit
c560d25d19
1 changed files with 5 additions and 2 deletions
|
@ -19,6 +19,7 @@ proto_ncm_init_config() {
|
||||||
proto_config_add_string mode
|
proto_config_add_string mode
|
||||||
proto_config_add_string pdptype
|
proto_config_add_string pdptype
|
||||||
proto_config_add_boolean ipv6
|
proto_config_add_boolean ipv6
|
||||||
|
proto_config_add_defaults
|
||||||
}
|
}
|
||||||
|
|
||||||
proto_ncm_setup() {
|
proto_ncm_setup() {
|
||||||
|
@ -26,8 +27,8 @@ proto_ncm_setup() {
|
||||||
|
|
||||||
local manufacturer initialize setmode connect ifname devname devpath
|
local manufacturer initialize setmode connect ifname devname devpath
|
||||||
|
|
||||||
local device apn auth username password pincode delay mode pdptype ipv6
|
local device apn auth username password pincode delay mode pdptype ipv6 $PROTO_DEFAULT_OPTIONS
|
||||||
json_get_vars device apn auth username password pincode delay mode pdptype ipv6
|
json_get_vars device apn auth username password pincode delay mode pdptype ipv6 $PROTO_DEFAULT_OPTIONS
|
||||||
|
|
||||||
if [ "$ipv6" = 0 ]; then
|
if [ "$ipv6" = 0 ]; then
|
||||||
ipv6=""
|
ipv6=""
|
||||||
|
@ -141,6 +142,7 @@ proto_ncm_setup() {
|
||||||
json_add_string name "${interface}_4"
|
json_add_string name "${interface}_4"
|
||||||
json_add_string ifname "@$interface"
|
json_add_string ifname "@$interface"
|
||||||
json_add_string proto "dhcp"
|
json_add_string proto "dhcp"
|
||||||
|
proto_add_dynamic_defaults
|
||||||
ubus call network add_dynamic "$(json_dump)"
|
ubus call network add_dynamic "$(json_dump)"
|
||||||
|
|
||||||
[ -n "$ipv6" ] && {
|
[ -n "$ipv6" ] && {
|
||||||
|
@ -149,6 +151,7 @@ proto_ncm_setup() {
|
||||||
json_add_string ifname "@$interface"
|
json_add_string ifname "@$interface"
|
||||||
json_add_string proto "dhcpv6"
|
json_add_string proto "dhcpv6"
|
||||||
json_add_string extendprefix 1
|
json_add_string extendprefix 1
|
||||||
|
proto_add_dynamic_defaults
|
||||||
ubus call network add_dynamic "$(json_dump)"
|
ubus call network add_dynamic "$(json_dump)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue