diff options
author | Koen Vandeputte <koen.vandeputte@ncentric.com> | 2018-02-15 15:16:02 +0100 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-02-18 09:34:32 +0100 |
commit | e9eb219e5a07f3e2284c1483da03d5accb130eac (patch) | |
tree | a3b8c18e5b83586a913e7b5ad9d244ac00b3980e | |
parent | 5661ac1de4d81c51cdc6f6f333bec3608ec43438 (diff) | |
download | upstream-e9eb219e5a07f3e2284c1483da03d5accb130eac.tar.gz upstream-e9eb219e5a07f3e2284c1483da03d5accb130eac.tar.bz2 upstream-e9eb219e5a07f3e2284c1483da03d5accb130eac.zip |
uqmi: use correct value for connection checking
Originally, the implementation only checked if uqmi command
execution succeeded properly without actually checking it's returned data.
This lead to a pass, even when the returned data was indicating an error.
Rework the verification to actually check the returned data,
which can only be correct if the uqmi command itself also executed correctly.
On command execution success, value "pdh_" is a pure numeric value.
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
-rwxr-xr-x | package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 12 |
1 files changed, 8 insertions, 4 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 eba0922e57..bdab5ee514 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -156,12 +156,14 @@ proto_qmi_setup() { ${username:+--username $username} \ ${password:+--password $password} \ ${autoconnect:+--autoconnect}) - [ $? -ne 0 ] && { + + # pdh_4 is a numeric value on success + if ! [ "$pdh_4" -eq "$pdh_4" ] 2> /dev/null; then echo "Unable to connect IPv4" uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds proto_notify_error "$interface" CALL_FAILED return 1 - } + fi } [ "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] && { @@ -182,12 +184,14 @@ proto_qmi_setup() { ${username:+--username $username} \ ${password:+--password $password} \ ${autoconnect:+--autoconnect}) - [ $? -ne 0 ] && { + + # pdh_6 is a numeric value on success + if ! [ "$pdh_6" -eq "$pdh_6" ] 2> /dev/null; then echo "Unable to connect IPv6" uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds proto_notify_error "$interface" CALL_FAILED return 1 - } + fi } echo "Setting up $ifname" |