diff options
author | Lech Perczak <lech.perczak@gmail.com> | 2023-05-03 14:34:25 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2023-05-07 14:36:58 +0200 |
commit | 1108f6cb8b115608c486552f1210fea5b955ea5f (patch) | |
tree | 9fcbc6ed829eaca29f4f5b3429ac1512c749120c /package | |
parent | 12b96757e5425c9fc4c38e564d0448ecf5655acc (diff) | |
download | openwrt-1108f6cb8b115608c486552f1210fea5b955ea5f.tar.gz openwrt-1108f6cb8b115608c486552f1210fea5b955ea5f.tar.bz2 openwrt-1108f6cb8b115608c486552f1210fea5b955ea5f.zip |
umbim: allow forcing DHCP/DHCPv6 configuration
To support the widest variety of modems, allow restoring previous
behaviour of configuring the link throug means of DHCP(v6) exclusively.
Change the default value of "dhcp" and "dhcpv6" UCI options to "auto",
while keeping the default behaviour of "prefer out-of-band configuration",
intact. Setting "dhcp" or "dhcpv6" to boolean 1 will now force using
DHCP and DHCPv6, respectively.
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Diffstat (limited to 'package')
-rwxr-xr-x | package/network/utils/umbim/files/lib/netifd/proto/mbim.sh | 16 |
1 files changed, 8 insertions, 8 deletions
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 bf07137fc4..50913e7fa0 100755 --- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh +++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh @@ -20,8 +20,8 @@ proto_mbim_init_config() { 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 dhcp + proto_config_add_string dhcpv6 proto_config_add_string pdptype proto_config_add_int mtu proto_config_add_defaults @@ -199,15 +199,15 @@ _proto_mbim_setup() { proto_init_update "$ifname" 1 proto_send_update "$interface" - [ -z "$dhcp" ] && dhcp=1 - [ -z "$dhcpv6" ] && dhcpv6=1 + [ -z "$dhcp" ] && dhcp="auto" + [ -z "$dhcpv6" ] && dhcpv6="auto" [ "$iptype" != "ipv6" ] && { json_init json_add_string name "${interface}_4" json_add_string ifname "@$interface" ipv4address=$(_proto_mbim_get_field ipv4address "$mbimconfig") - if [ -n "$ipv4address" ]; then + if [ -n "$ipv4address" -a "$dhcp" != 1 ]; then json_add_string proto "static" json_add_array ipaddr @@ -222,7 +222,7 @@ _proto_mbim_setup() { json_add_string proto "dhcp" fi - [ "$peerdns" = 0 ] || { + [ "$peerdns" = 0 -a "$dhcp" != 1 ] || { json_add_array dns for server in $(_proto_mbim_get_field ipv4dnsserver "$mbimconfig"); do json_add_string "" "$server" @@ -242,7 +242,7 @@ _proto_mbim_setup() { json_add_string name "${interface}_6" json_add_string ifname "@$interface" ipv6address=$(_proto_mbim_get_field ipv6address "$mbimconfig") - if [ -n "$ipv6address" ]; then + if [ -n "$ipv6address" -a "$dhcpv6" != 1 ]; then json_add_string proto "static" json_add_array ip6addr @@ -265,7 +265,7 @@ _proto_mbim_setup() { json_add_string extendprefix 1 fi - [ "$peerdns" = 0 ] || { + [ "$peerdns" = 0 -a "$dhcpv6" != 1 ] || { json_add_array dns for server in $(_proto_mbim_get_field ipv6dnsserver "$mbimconfig"); do json_add_string "" "$server" |