From e2655e0a6beacc45ae763b509cb447d4777aecf6 Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Tue, 20 Jul 2021 22:57:10 +0200 Subject: [PATCH] umbim: respect 'Enable IPv6 negotiation' option Don't bring IPv6 part of interface up if it's disabled, or system does not support it. Signed-off-by: Lech Perczak --- package/network/utils/umbim/files/lib/netifd/proto/mbim.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh index 294dc64400a3..aee0feb4bab5 100755 --- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh +++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh @@ -19,6 +19,7 @@ proto_mbim_init_config() { proto_config_add_string auth proto_config_add_string username proto_config_add_string password + [ -e /proc/sys/net/ipv6 ] && proto_config_add_string ipv6 proto_config_add_boolean dhcp proto_config_add_boolean dhcpv6 proto_config_add_string pdptype @@ -33,6 +34,8 @@ _proto_mbim_setup() { local device apn pincode delay allow_roaming allow_partner dhcp dhcpv6 pdptype $PROTO_DEFAULT_OPTIONS json_get_vars device apn pincode delay auth username password allow_roaming allow_partner dhcp dhcpv6 pdptype $PROTO_DEFAULT_OPTIONS + [ ! -e /proc/sys/net/ipv6 ] && ipv6=0 || json_get_var ipv6 ipv6 + [ -n "$ctl_device" ] && device=$ctl_device [ -n "$device" ] || { @@ -150,6 +153,7 @@ _proto_mbim_setup() { tid=$((tid + 1)) pdptype=$(echo "$pdptype" | awk '{print tolower($0)}') + [ "$ipv6" = 0 ] && pdptype="ipv4" local req_pdptype="" # Pass "default" PDP type to umbim if unconfigured [ "$pdptype" = "ipv4" -o "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] && req_pdptype="$pdptype:" -- 2.30.2