aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Eckert <Eckert.Florian@googlemail.com>2016-07-22 11:04:57 +0200
committerJohn Crispin <john@phrozen.org>2016-07-26 08:39:36 +0200
commit109c55aea1c6a1fbc6d39c19dad31c0f839e2255 (patch)
tree478c63b5669b18892758d19d1b3a487bfda2dbce
parent15867deac8c9fd571e01532db03db08b515a3b42 (diff)
downloadupstream-109c55aea1c6a1fbc6d39c19dad31c0f839e2255.tar.gz
upstream-109c55aea1c6a1fbc6d39c19dad31c0f839e2255.tar.bz2
upstream-109c55aea1c6a1fbc6d39c19dad31c0f839e2255.zip
uqmi: add metric option to interface config
It is now possible to add an metric option for the qmi proto in dhcp mode. Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com>
-rwxr-xr-xpackage/network/utils/uqmi/files/lib/netifd/proto/qmi.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 6dcc226693..32df6ee9b1 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -19,20 +19,23 @@ proto_qmi_init_config() {
proto_config_add_string modes
proto_config_add_boolean ipv6
proto_config_add_boolean dhcp
+ proto_config_add_int metric
}
proto_qmi_setup() {
local interface="$1"
- local device apn auth username password pincode delay modes ipv6 dhcp
+ local device apn auth username password pincode delay modes ipv6 dhcp metric
local cid_4 pdh_4 cid_6 pdh_6 ipv4
local ip subnet gateway dns1 dns2 ip_6 ip_prefix_length gateway_6 dns1_6 dns2_6
- json_get_vars device apn auth username password pincode delay modes ipv6 dhcp
+ json_get_vars device apn auth username password pincode delay modes ipv6 dhcp metric
ipv4=1
[ "$ipv6" = 1 ] || ipv6=""
+ [ "$metric" = "" ] && metric="0"
+
[ -n "$ctl_device" ] && device=$ctl_device
[ -n "$device" ] || {
@@ -200,6 +203,7 @@ proto_qmi_setup() {
json_add_string name "${interface}_4"
json_add_string ifname "@$interface"
json_add_string proto "dhcp"
+ json_add_int metric "$metric"
json_close_object
ubus call network add_dynamic "$(json_dump)"
}
@@ -209,6 +213,7 @@ proto_qmi_setup() {
json_add_string name "${interface}_6"
json_add_string ifname "@$interface"
json_add_string proto "dhcpv6"
+ json_add_int metric "$metric"
# RFC 7278: Extend an IPv6 /64 Prefix to LAN
json_add_string extendprefix 1
json_close_object