From patchwork Thu Feb 15 14:16:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koen Vandeputte X-Patchwork-Id: 873889 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=2607:7c80:54:e::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="uVixI71O"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ncentric.com header.i=@ncentric.com header.b="Da+r3qMV"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::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 3zhz1C5sH2z9sRm for ; Fri, 16 Feb 2018 01:19: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=uVixI71OlF2pmk sBVNV+OVfC1CM2JbXr3rdtw8cMQvQhWfR0/AWUu4pn9yB7B8vDXMq7HgW6zkb+rleyRTFM/hDkthV m+h1ons4eHVLpJkHm3UhNve9pneyYaYDq23g9wgOWqPTVMoDkAyjT4vTEZG4ues7XdYqzr+/0VxxP u5V1jSckM3vqNPE8tr7f7O/kBQRCBsIcSdffDjFswSXgeaOMULUoG3lv5rQypD3lAPUydCZXS3JUi NXtXY+dj7NF4556x0F+s8es58jSpCkhfZB5lrqW7QhZU9rQYrAKspUEjZo07APJN4cLDkKtv8nel5 YKZNPxfMYhokBKZ7OmCg==; 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 1emKNd-0000N8-EZ; Thu, 15 Feb 2018 14:19:21 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1emKLI-00075B-9o for lede-dev@lists.infradead.org; Thu, 15 Feb 2018 14:17:00 +0000 Received: by mail-wm0-x232.google.com with SMTP id 141so1107880wme.3 for ; Thu, 15 Feb 2018 06:16:48 -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=Da+r3qMVTDjNhrs/VppzG+5cOjLtsTnFLE4U3TpZXGgh2zUnHNkLPtqsMMtVH2OLmN DCq8nGCi1Yy2B0RNOF4gA0GMoRoK6/haI5JuA1hw91tXOfWUszHJR1PqYgbd27SlVTWQ 6Wt45lfsEgNxbjQsLpl/f/b7exnETjhhoaNVA= 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=Pr9JRcVP4H4HW01/d9fnTc0AHCBR5otikn3tHIphIncXxg5BE+fERXvOUzAeufMSkj T27dEONRLvKpa9R8x65p98APoHpalbsOUhxSU1y9CjUMHOXlv6ib7aKkY/2wH3t07wlo fUbmuPayA0El3XTNcrqQ3th2VH1KkUfu1zYminKdotQp8iaYuUplZQ05qNC1NICQItIw zL1kLslSOCtbDuuuUwGbI/tgx3ynq0ZCSTFLifSBec/qeKBVzuzDKVUhW+72NAQuN7rd 9Zm5LI3/qBqP21qDv3ubW6OMclleBFsJnrghsT5i8iDGJI95jQuLEuapJyrWg1e7vXr2 4ONQ== X-Gm-Message-State: APf1xPAFVAWeFSGM2rKczV33imBrzLyiqIbkx+Ol7e0Tj8fGHRa4anRl 5irsS00dIwTIcg3Lfe3cuIRnToPANw0= X-Google-Smtp-Source: AH8x227IxdOMuQhvN1z0R5s8/vuRXYeZVMuFWted5C08iWuhoparUZcLdt708ZpPrkWmqOQmtesHmA== X-Received: by 10.80.183.173 with SMTP id h42mr3548674ede.287.1518704207233; Thu, 15 Feb 2018 06:16:47 -0800 (PST) Received: from localhost.localdomain (d515300d8.static.telenet.be. [81.83.0.216]) by smtp.googlemail.com with ESMTPSA id d6sm3462692edm.52.2018.02.15.06.16.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Feb 2018 06:16:46 -0800 (PST) From: Koen Vandeputte To: lede-dev@lists.infradead.org Date: Thu, 15 Feb 2018 15:16:02 +0100 Message-Id: <1518704164-22198-8-git-send-email-koen.vandeputte@ncentric.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518704164-22198-1-git-send-email-koen.vandeputte@ncentric.com> References: <1518704164-22198-1-git-send-email-koen.vandeputte@ncentric.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180215_061656_440856_1FB5993C X-CRM114-Status: GOOD ( 11.17 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:232 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 7/9] 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: leventelist@gmail.com, lynxis@fe80.eu, Koen Vandeputte , john@phrozen.org, bjorn@mork.no, nbd@nbd.name 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"