Skip to content
Snippets Groups Projects
Commit e16cc7a8 authored by Koen Vandeputte's avatar Koen Vandeputte Committed by John Crispin
Browse files

uqmi: ensure CID is a numeric value before proceeding


The current implementation only checked if uqmi itself executed
correctly which is also the case when the returned value is actually
an error.

Rework this, checking that CID is a numeric value, which can only
be true if uqmi itself also executed correctly.

Signed-off-by: default avatarKoen Vandeputte <koen.vandeputte@ncentric.com>
parent 2f85985d
No related branches found
No related tags found
No related merge requests found
...@@ -140,11 +140,11 @@ proto_qmi_setup() { ...@@ -140,11 +140,11 @@ proto_qmi_setup() {
[ "$pdptype" = "ip" -o "$pdptype" = "ipv4v6" ] && { [ "$pdptype" = "ip" -o "$pdptype" = "ipv4v6" ] && {
cid_4=$(uqmi -s -d "$device" --get-client-id wds) cid_4=$(uqmi -s -d "$device" --get-client-id wds)
[ $? -ne 0 ] && { if ! [ "$cid_4" -eq "$cid_4" ] 2> /dev/null; then
echo "Unable to obtain client ID" echo "Unable to obtain client ID"
proto_notify_error "$interface" NO_CID proto_notify_error "$interface" NO_CID
return 1 return 1
} fi
uqmi -s -d "$device" --set-client-id wds,"$cid_4" --set-ip-family ipv4 > /dev/null uqmi -s -d "$device" --set-client-id wds,"$cid_4" --set-ip-family ipv4 > /dev/null
...@@ -177,11 +177,11 @@ proto_qmi_setup() { ...@@ -177,11 +177,11 @@ proto_qmi_setup() {
[ "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] && { [ "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] && {
cid_6=$(uqmi -s -d "$device" --get-client-id wds) cid_6=$(uqmi -s -d "$device" --get-client-id wds)
[ $? -ne 0 ] && { if ! [ "$cid_6" -eq "$cid_6" ] 2> /dev/null; then
echo "Unable to obtain client ID" echo "Unable to obtain client ID"
proto_notify_error "$interface" NO_CID proto_notify_error "$interface" NO_CID
return 1 return 1
} fi
uqmi -s -d "$device" --set-client-id wds,"$cid_6" --set-ip-family ipv6 > /dev/null uqmi -s -d "$device" --set-client-id wds,"$cid_6" --set-ip-family ipv6 > /dev/null
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment