From patchwork Wed Feb 7 12:23:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koen Vandeputte X-Patchwork-Id: 870341 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="r4HK1c6J"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ncentric.com header.i=@ncentric.com header.b="phtd8nBj"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zc0qz6B7lz9s71 for ; Wed, 7 Feb 2018 23:24:15 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xbVgjKPJcM7ibjOoepZiStgqKjF+BCV8ILRbyS10t60=; b=r4HK1c6Jl5qPoL D1EUExEql7hjqVlKg/av1WN5mkCBRXeIxP86ybb+YNU2GG5VoMvvoyTT2Gr9A9rrWZBr2ZT8uY+pA xhsrACfcRli+xuFvs6ccTISxX4l4VB7GS7IfZd/DmW7h8m+tj3tf4lGaKV5Dns+i9jHvx45jDFo6V hg5sIIrdo/y2hY92VkLYBKoM46ctiEp4xTFdT1gScSEa9wDB2A9MRfSCArUKwndwqYd7TxwyHTCNm vBTNK2kNELK+/95Koj0j2VenbeI3igZ1i1RHo+XfTsBZFnZ2dSRC+EHFIMvgWn3dvKJLUYw8OHCXT I/VR8hedDDM262JYcU1w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ejOlo-0004MR-TE; Wed, 07 Feb 2018 12:24:12 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ejOld-0004DX-NG for lede-dev@lists.infradead.org; Wed, 07 Feb 2018 12:24:03 +0000 Received: by mail-wm0-x244.google.com with SMTP id r71so2813814wmd.1 for ; Wed, 07 Feb 2018 04:23:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ncentric.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3jp9fTY8gz5PDJHg2jTYvOR9St8qHhDRyW5e0L4v56U=; b=phtd8nBj7jzbr4jeFUDUqUihhRFBBMFSXamzQ/KFf5jf7d6QBI+ogM7GUxIQVvF2NH hWirR51dZjVvspX4PG+fim3tjEVv1no8gz3s8hCGSp8NYG71BJLee/W0TJpIkQWFW5gL iN+oywaZCUIkn0UFn7nNUwZuzQIi9cokhXwuI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3jp9fTY8gz5PDJHg2jTYvOR9St8qHhDRyW5e0L4v56U=; b=eXq6Xqv+dqYpMcK+uyOHLvq0jDsTO6bFMC4FjSteOWDFAjsNznbXrDUsLPyI+uU9pr YhDp+AL5JcccRIdmgims4SeWYNEM+UI+XTsnYdEunJXlcPfW6oC9bQQt71f4CGy91GtY +i2hTqVhhb+RcNiLZUL9q0ImPQtLugWXYtOfj5uFlsQhMRN2i9xIQflH6BBN13ZIaBbL Q1OR7/5kzs9UA/ouIn8/VNZIHYebmKLAM2azJjO6SBSRLpfBMkjgkMO+4Oi4CfUyhQ6L DNbKBzWCmrJURSMfADsCjsF7N9QB2RBOU09td+SN8B5SHXNUD3aWvmlWmIyjQJJTQQlG sgxw== X-Gm-Message-State: APf1xPByLASMl0ecj/9gJrVPWsvKxsEoh6sj8xWWfYzygUxXfhqEvyRc K1VNti9eNDVnhsiF827j+Dx6uiMTqb4= X-Google-Smtp-Source: AH8x226HkaPsde04WmR20NwP7OlD1JkEpYz5W9u60z7/p4JuwsBYCVmb3aB7Olhvuyyd+LPIiWwKpA== X-Received: by 10.80.167.162 with SMTP id i31mr8127722edc.37.1518006230011; Wed, 07 Feb 2018 04:23:50 -0800 (PST) Received: from localhost.localdomain (d515300d8.static.telenet.be. [81.83.0.216]) by smtp.googlemail.com with ESMTPSA id m17sm1152621edc.31.2018.02.07.04.23.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Feb 2018 04:23:49 -0800 (PST) From: Koen Vandeputte To: lede-dev@lists.infradead.org Date: Wed, 7 Feb 2018 13:23:26 +0100 Message-Id: <1518006208-16112-2-git-send-email-koen.vandeputte@ncentric.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518006208-16112-1-git-send-email-koen.vandeputte@ncentric.com> References: <1518006208-16112-1-git-send-email-koen.vandeputte@ncentric.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c09:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [LEDE-DEV] [PATCH 1/3] uqmi: use general method for state cleaning X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nbd@nbd.name, lynxis@fe80.eu, Koen Vandeputte , john@phrozen.org MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Debugging shows that using the general method properly cleans on each run, while the method specifying the client-ID shows "No effect" even while in connected state. Fixes several connectivity issues seen on specific modems. Signed-off-by: Koen Vandeputte --- package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 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 1619c2b35eb9..eba0922e57de 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -97,6 +97,10 @@ proto_qmi_setup() { } } + # Cleanup current state if any + uqmi -s -d "$device" --stop-network 0xffffffff --autoconnect + + # Set IP format uqmi -s -d "$device" --set-data-format 802.3 uqmi -s -d "$device" --wda-set-data-format 802.3 dataformat="$(uqmi -s -d "$device" --wda-get-data-format)" @@ -144,11 +148,6 @@ proto_qmi_setup() { uqmi -s -d "$device" --set-client-id wds,"$cid_4" --set-ip-family ipv4 > /dev/null - # try to clear previous autoconnect state - uqmi -s -d "$device" --set-client-id wds,"$cid_4" \ - --stop-network 0xffffffff \ - --autoconnect > /dev/null - pdh_4=$(uqmi -s -d "$device" --set-client-id wds,"$cid_4" \ --start-network \ ${apn:+--apn $apn} \ @@ -175,11 +174,6 @@ proto_qmi_setup() { uqmi -s -d "$device" --set-client-id wds,"$cid_6" --set-ip-family ipv6 > /dev/null - # try to clear previous autoconnect state - uqmi -s -d "$device" --set-client-id wds,"$cid_6" \ - --stop-network 0xffffffff \ - --autoconnect > /dev/null - pdh_6=$(uqmi -s -d "$device" --set-client-id wds,"$cid_6" \ --start-network \ ${apn:+--apn $apn} \ From patchwork Wed Feb 7 12:23:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koen Vandeputte X-Patchwork-Id: 870342 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GnmRofiW"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ncentric.com header.i=@ncentric.com header.b="YGajWl67"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zc0rC6vzxz9ryk for ; Wed, 7 Feb 2018 23:24:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vFNo6BEGpBujzer3X2uTaGunFKaxDaaDYyCWjMNWi3g=; b=GnmRofiWgI6Y9F +G6W4IH7Uuq/G1cYqNxN+qbS0G7UkODWWyIZTTJpBhh48j1N5Td0fuIzdcmSnhNM1UAhxyA9qTM7e HFCCo5yohhk6ZU87bvyT+tIvZGCn7fwIWrbqbrlakQSgAPyPGDyhmHb0u/pYJv209rVv51eYhkxNM VJdDNZGqTDu4/avbf82YivI1bwqgRqpvkNQJ801SXuFU4/3dAFvjNm+8TKDT2dduyMGVpjIJs0QR9 548GT9rSYfUlATwDAOlXoxYQiirKZkQHxFG+EtoQHIssORTzw8b5oB7lMUvEum7rktgLLrWqqNtz1 W7BnrKNDeQo+oUzWK+2Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ejOlz-0004fl-OD; Wed, 07 Feb 2018 12:24:23 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ejOle-0004Db-VT for lede-dev@lists.infradead.org; Wed, 07 Feb 2018 12:24:04 +0000 Received: by mail-wm0-x241.google.com with SMTP id b21so2959339wme.4 for ; Wed, 07 Feb 2018 04:23:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ncentric.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rSnQsxXCAiXnU1H8ncpS8lfcNewbvKYngXN7MjNpn8k=; b=YGajWl673PZAG6SXJOicDe8OvLL+ycY6RZ7d9eK+fltXtHkDLgyjOs40Y0sA6kV8/W 4bzjXgwXG9uh6wdkrhFsARZuaVs7LcRRu1T5+lY2dwHiSmxdq9o3jIPLl8wGHFocx5VB Re0JXrsJ8POR88uJSRTyrg0tsOyTcrZSqzvjw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rSnQsxXCAiXnU1H8ncpS8lfcNewbvKYngXN7MjNpn8k=; b=B9DcxH67OqleetV83hSL+htNCXlmZcIOnDENMOGv8zs5JIjPG9kyHj3gtv3zlol0ON w4djbonYK4sLf2bFfIT+rX7/lXXBnPUORpUMm+z6HGWucnnFYfgqqh95/Da4vyN2IZ5N IXiqdwcSOBC+J4WbMgEDtBJ0xDJpRUyCmzCyGzJ8lvMPKlcSkj/2IxwclUIfx59Gpz6K A2pW1smsjdocsa4ZHSOADgEM6ZPHwk/AKXNEWPRdUu7qLelv3Qm93+lZjbHYjoVE/iR8 CnuCpNwpImnZHOVyvgUc3CJ3C56eJA0+8wVZEynzsqqqReh0WOw83hx7kwLG4EDXs7fK EZ0g== X-Gm-Message-State: APf1xPBX6JZs17DSLGeEtD33cOKIPmcWnQrNvpOhyeY601xhZUxOKCRW 0xdyxIJAGjzI/gyxOJTOsFna4zxZNy0= X-Google-Smtp-Source: AH8x224QkqRMrQXiKr6v5LZOeLTUTB3tNIXamBt4Yk3vKq0Vl0h9TwRTUyR6ptVU8/tZo8DyMcdE+Q== X-Received: by 10.80.182.181 with SMTP id d50mr8497341ede.116.1518006230941; Wed, 07 Feb 2018 04:23:50 -0800 (PST) Received: from localhost.localdomain (d515300d8.static.telenet.be. [81.83.0.216]) by smtp.googlemail.com with ESMTPSA id m17sm1152621edc.31.2018.02.07.04.23.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Feb 2018 04:23:50 -0800 (PST) From: Koen Vandeputte To: lede-dev@lists.infradead.org Date: Wed, 7 Feb 2018 13:23:27 +0100 Message-Id: <1518006208-16112-3-git-send-email-koen.vandeputte@ncentric.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518006208-16112-1-git-send-email-koen.vandeputte@ncentric.com> References: <1518006208-16112-1-git-send-email-koen.vandeputte@ncentric.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c09:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [LEDE-DEV] [PATCH 2/3] uqmi: use correct value for connection checking X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nbd@nbd.name, lynxis@fe80.eu, Koen Vandeputte , john@phrozen.org MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 --- package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 12 ++++++++---- 1 file 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 eba0922e57de..bdab5ee5143b 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" From patchwork Wed Feb 7 12:23:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koen Vandeputte X-Patchwork-Id: 870343 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HuFnWPYG"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ncentric.com header.i=@ncentric.com header.b="lpdo3s39"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zc0rN2krBz9ryk for ; Wed, 7 Feb 2018 23:24:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9anMSoGrwfRjwFnytcIvkFOt8cEKnkVLSkoGNlRPFoM=; b=HuFnWPYGw/sfuS mn8taGCqDt9ImBFz0gIaBfjx/vOyV1PbYhx7uwgRpSG4FYSMDx/lRKd+GDLDydIXfTITjJ2oZGaJP N2BRRK5WpVPKYHWGZfUd2zLnRuEaLdbsjo7i08ZXwMZuVEU+3HOMKkhfSAjvTGWdK+p7jleGzUrzu l8xBBM+6CDk6WbjLcpce4U2+39kIGrMyOGy7LkjGQt+b6n9WPxkKINC5qkSvY1R2GnJHEbmVw0fOl YxjryJvY6AfR6+niE4ewxNDxNh01xBBV6dyiiHed5V5cBoIk2O/bDPK1j/GHF5+j7DFuPBOZQ2aZ4 bsrCjogND3lmfHTbiAXw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ejOmA-0004tQ-2y; Wed, 07 Feb 2018 12:24:34 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ejOlf-0004Dd-QF for lede-dev@lists.infradead.org; Wed, 07 Feb 2018 12:24:05 +0000 Received: by mail-wm0-x243.google.com with SMTP id f3so2973073wmc.1 for ; Wed, 07 Feb 2018 04:23:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ncentric.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ooMc0XveajF2+xlkQQk1v3vTpQrYheD3XpzDKzuMmBU=; b=lpdo3s39mDoGN21AgQlwnEXaYkJobHAngLQlxnZskfZTxAFptXtyG06+nitKs509kV 99O5aiJ11pVWivbKJWtdoe1ORPC6AO2ae87QI1bfvGXflvVK/GtQoC587fVBY0cMWDIc z9XwpZx6htWzLPf5em80l6Lg/G2k6k/VMIK6s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ooMc0XveajF2+xlkQQk1v3vTpQrYheD3XpzDKzuMmBU=; b=CSDajeAX8V5OowWyjx0BuoW8/tDZYUT+BFXCMcaLB9A+/MXZ9FULjfYnljRoO0Scin HS5VoJY45T31NdSXakABWhQi9h8tqhRgeQmlOhIxBdSOwincF0651UzDm/VF1n4IrOLt SbmIyJPL4xLEZr9Mb7ilgOcAhgZgMRGmpBCCN4gTBKexYFK7/ERQFCdYS9xkpwsAKw6A GJlxIBIdQq0UxKy3BQVAvht3ODalWUd/CAJrgUUXxHGh9pNyPWT+i4YUip+BAToS2zk1 JCOq+ZhwloAfvIH9qByU0oqvZGRxUNyoYuFylQmQ5Q7wItCuFN5H7xdP8XiVKc/5xR49 01lQ== X-Gm-Message-State: APf1xPDvxgzbIBRNkb7e43wSFVE1bncWsmzmsZmZI1dTLLrgr4Hf+VCd QiLrXQKMKCUuhZ+HjqT0UB5YMKl7j9c= X-Google-Smtp-Source: AH8x226zSHAqGtXdJT9olusqxCv0pS/H0atSRAT7XwiV+K7a/gQn33qWZrk7hTxG44svuSfkAvpyMw== X-Received: by 10.80.145.115 with SMTP id f48mr8098869eda.92.1518006231773; Wed, 07 Feb 2018 04:23:51 -0800 (PST) Received: from localhost.localdomain (d515300d8.static.telenet.be. [81.83.0.216]) by smtp.googlemail.com with ESMTPSA id m17sm1152621edc.31.2018.02.07.04.23.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Feb 2018 04:23:51 -0800 (PST) From: Koen Vandeputte To: lede-dev@lists.infradead.org Date: Wed, 7 Feb 2018 13:23:28 +0100 Message-Id: <1518006208-16112-4-git-send-email-koen.vandeputte@ncentric.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518006208-16112-1-git-send-email-koen.vandeputte@ncentric.com> References: <1518006208-16112-1-git-send-email-koen.vandeputte@ncentric.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c09:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [LEDE-DEV] [PATCH 3/3] uqmi: use built-in command for data-link verification X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nbd@nbd.name, lynxis@fe80.eu, Koen Vandeputte , john@phrozen.org MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org uqmi contains a command for directly querying the modem if there is a valid data connection, so let's use it. This avoids the cases were all previous tests are succesful, but the actual data link is not up for some reasons, leading to states were we thought the link was up when it actually wasn't .. Signed-off-by: Koen Vandeputte --- .../network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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 bdab5ee5143b..c3da5ede26b1 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -27,7 +27,7 @@ proto_qmi_init_config() { proto_qmi_setup() { local interface="$1" - local dataformat + local dataformat connstat local device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn $PROTO_DEFAULT_OPTIONS local cid_4 pdh_4 cid_6 pdh_6 local ip_6 ip_prefix_length gateway_6 dns1_6 dns2_6 @@ -164,6 +164,15 @@ proto_qmi_setup() { proto_notify_error "$interface" CALL_FAILED return 1 fi + + # Check data connection state + connstat=$(uqmi -s -d "$device" --get-data-status) + [ "$connstat" == '"connected"' ] || { + echo "No data link!" + uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds + proto_notify_error "$interface" CALL_FAILED + return 1 + } } [ "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] && { @@ -192,6 +201,15 @@ proto_qmi_setup() { proto_notify_error "$interface" CALL_FAILED return 1 fi + + # Check data connection state + connstat=$(uqmi -s -d "$device" --get-data-status) + [ "$connstat" == '"connected"' ] || { + echo "No data link!" + uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds + proto_notify_error "$interface" CALL_FAILED + return 1 + } } echo "Setting up $ifname"