aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2018-04-12 13:20:49 +0200
committerJo-Philipp Wich <jo@mein.io>2018-12-18 17:22:06 +0100
commit1e012fd697d87a2ace9e0c2e046a206b377dc18c (patch)
tree1d28b7fcfe9ed4358427c2c43c28e1e4e5323ab8
parent5c10aaa65b1cb054d584b5abad73582975864e19 (diff)
downloadupstream-1e012fd697d87a2ace9e0c2e046a206b377dc18c.tar.gz
upstream-1e012fd697d87a2ace9e0c2e046a206b377dc18c.tar.bz2
upstream-1e012fd697d87a2ace9e0c2e046a206b377dc18c.zip
uqmi: do not block proto handler if modem is unable to registrate
QMI proto setup-handler will wait forever if it is unable to registrate to the mobile network. To fix this stop polling network registration status and notify netifd. Netifd will generate then a "ifup-failed" ACTION. Signed-off-by: Florian Eckert <fe@dev.tdt.de> (backported from dec1bfa0f48d43174921d1a1357a4842f9ba0cf6)
-rwxr-xr-xpackage/network/utils/uqmi/files/lib/netifd/proto/qmi.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 560c0b9459..f1a939763a 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -125,9 +125,18 @@ proto_qmi_setup() {
uqmi -s -d "$device" --sync > /dev/null 2>&1
echo "Waiting for network registration"
+ local registration_timeout=0
while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do
[ -e "$device" ] || return 1
- sleep 5;
+ if [ "$registration_timeout" -lt "$timeout" ]; then
+ let registration_timeout++
+ sleep 1;
+ else
+ echo "Network registration failed"
+ proto_notify_error "$interface" NETWORK_REGISTRATION_FAILED
+ proto_block_restart "$interface"
+ return 1
+ fi
done
[ -n "$modes" ] && uqmi -s -d "$device" --set-network-modes "$modes" > /dev/null 2>&1