From: Lech Perczak Date: Tue, 20 Jul 2021 20:57:10 +0000 (+0200) Subject: umbim: respect 'Enable IPv6 negotiation' option X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=e2655e0a6beacc45ae763b509cb447d4777aecf6;p=openwrt%2Fstaging%2Fdangole.git 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 --- 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 294dc64400..aee0feb4ba 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:"