aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLech Perczak <lech.perczak@gmail.com>2023-01-09 22:08:07 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2023-04-29 21:33:04 +0200
commitda84eddedbf0abc8e17b0bfbeac53de1bca1a918 (patch)
tree8e6910d47efe8b5b6b864cf492279cc5b42fe761
parent0be14c622b809e7d3551c21e7ac6dbae6b0403f8 (diff)
downloadupstream-da84eddedbf0abc8e17b0bfbeac53de1bca1a918.tar.gz
upstream-da84eddedbf0abc8e17b0bfbeac53de1bca1a918.tar.bz2
upstream-da84eddedbf0abc8e17b0bfbeac53de1bca1a918.zip
umbim: fail connect step immediately
Subsequent calls to 'umbim connect' do not have any effect if a failure occured, and in such case an infinite loop without timeout is created, leading to possibility of interface stuck at connecting forever. Drop this loop, and issue MBIM disconnect properly, so netifd can restart from scratch. This issue can be observed with Sierra EM7455 at changing APN, which causes network re-registration by default, and a MBIM transaction timeout, which is resolved on next interface bringup by netifd. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
-rwxr-xr-xpackage/network/utils/umbim/files/lib/netifd/proto/mbim.sh9
1 files changed, 6 insertions, 3 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 08f95ddc6f..c6fa6665ef 100755
--- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
+++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
@@ -152,10 +152,13 @@ _proto_mbim_setup() {
[ "$pdptype" = "ipv4" -o "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] || pdptype="ipv4v6"
echo "mbim[$$]" "Connect to network"
- while ! umbim $DBG -n -t $tid -d $device connect "$pdptype:$apn" "$auth" "$username" "$password"; do
+ umbim $DBG -n -t $tid -d $device connect "$pdptype:$apn" "$auth" "$username" "$password" || {
+ echo "mbim[$$]" "Failed to connect bearer"
tid=$((tid + 1))
- sleep 1;
- done
+ umbim $DBG -t $tid -d "$device" disconnect
+ proto_notify_error "$interface" CONNECT_FAILED
+ return 1
+ }
tid=$((tid + 1))
echo "mbim[$$]" "Connected"