[source] comgt: add metric, defaultroute and peerdns options for ncm protocol

LEDE Commits lede-commits at lists.infradead.org
Wed Oct 26 03:46:36 PDT 2016


blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/c560d25d19bd5a9412a4672cacf2a9f2ed601897

commit c560d25d19bd5a9412a4672cacf2a9f2ed601897
Author: Marcin Jurkowski <marcin1j at gmail.com>
AuthorDate: Mon Oct 17 02:38:42 2016 +0200

    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 at gmail.com>
---
 package/network/utils/comgt/files/ncm.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh
index 571cfaa..1f4d8a4 100644
--- a/package/network/utils/comgt/files/ncm.sh
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -19,6 +19,7 @@ proto_ncm_init_config() {
 	proto_config_add_string mode
 	proto_config_add_string pdptype
 	proto_config_add_boolean ipv6
+	proto_config_add_defaults
 }
 
 proto_ncm_setup() {
@@ -26,8 +27,8 @@ proto_ncm_setup() {
 
 	local manufacturer initialize setmode connect ifname devname devpath
 
-	local device apn auth username password pincode delay mode pdptype ipv6
-	json_get_vars 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 $PROTO_DEFAULT_OPTIONS
 	
 	if [ "$ipv6" = 0 ]; then
 		ipv6=""
@@ -141,6 +142,7 @@ proto_ncm_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)"
 
 	[ -n "$ipv6" ] && {
@@ -149,6 +151,7 @@ proto_ncm_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)"
 	}
 }



More information about the lede-commits mailing list