[openwrt/openwrt] umbim: respect 'Enable IPv6 negotiation' option
LEDE Commits
lede-commits at lists.infradead.org
Sat Apr 29 12:39:13 PDT 2023
hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e2655e0a6beacc45ae763b509cb447d4777aecf6
commit e2655e0a6beacc45ae763b509cb447d4777aecf6
Author: Lech Perczak <lech.perczak at gmail.com>
AuthorDate: Tue Jul 20 22:57:10 2021 +0200
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 <lech.perczak at gmail.com>
---
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 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:"
More information about the lede-commits
mailing list