From patchwork Mon Feb 19 10:02:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koen Vandeputte X-Patchwork-Id: 875065 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="rt9nLrTe"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ncentric.com header.i=@ncentric.com header.b="och21HH3"; 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 3zlK7s1yJPz9ryJ for ; Mon, 19 Feb 2018 21:03:21 +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:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=byWvJHhsRKUMN1o43vsaBTBl0w1pQQdMavnPMQ1pkjA=; b=rt9nLrTeNPTUUi qCLMc0EAjP/OhxWjtQ0xJsU/Y3phDctsoWTZ4v2pxkkfTHs6BDlU//pw2uwYh+GeTHH6p67aJ9uuQ VMUIchF642JdkdpktKBpgZ0GRjMxW07G+UgUeysG56EoDCCysU7/3mftn6fzxmkgN27iaTEqUPLPh iw5J7H497+wIL8lRTbDCNpHyDd12mdDouxpaRSn0Qm7EBfOO9ByRMScYsS5dh36Zbe3pnna7Q8ZC9 JszM9uK7INUmKo0eS41aaJcwPIIKQOeUTzlIOf7HmIiFCRCBdigg2QuhEIGbC8XQJeMsg+yQCBlmX HK5bOCD/+Gt3sYu604yg==; 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 1eniHu-0007zp-Pv; Mon, 19 Feb 2018 10:03:10 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eniHn-0007yR-Lq for lede-dev@lists.infradead.org; Mon, 19 Feb 2018 10:03:09 +0000 Received: by mail-wm0-x242.google.com with SMTP id h21so6637980wmd.1 for ; Mon, 19 Feb 2018 02:02: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; bh=t8WF3SjL8pMgAFiLAZr6wXpFe7wqMCtct+DUqBvmltw=; b=och21HH3VhdPEvU0158kZVL0gsrNK/y2xvVMdMCeJg5l/CFnOIvQhZYIeOrmRy+Ug3 L0sZVx/wO2r5nIYhKC/IAD71IG1IVJugz9Y/fd1WjdjjjDNy1IYnHhOe7clMN5fSULuY xhl+j/oy5Fy5LIeJkhEjThYmR/JKADCazdXZc= 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; bh=t8WF3SjL8pMgAFiLAZr6wXpFe7wqMCtct+DUqBvmltw=; b=dg6JyXmp3xICNaW69wKZ5I3EsnK9MlhOOdsEbxwUmu69N7/aECx1S/gHa/3oBQEcke g+mtjLeNNQJHM9EHD0lJugaekAJDlP6puhDTo0/lW3FYFTpH3zjjn6I5/BSFekN4fr28 wrFnhaPjp/g0oTVZgHuzJyjFAjbJg/D5BWkyJz0QxjaesNHYpddDuB3D70eF8pbxEftH O6gf7WxFVd59DTQ4zlqY+2w/BLU+nYRTpzVPOK3LlpDiiUsSWRzmoVz9IZf7oRyjmrfG 7ixnAzdKSJH9/jsF5fqe2Nq3A3FgKWqv5Yk6feAGQI01PqlRprTcqTqAz8S3Ir4hz5Bs mBAw== X-Gm-Message-State: APf1xPCSQ1FknHrlcb6t10gpk9JBm5z9AFN1ojtC6KkMUt1dIOGoX1bg P4o69/nPM5x5vNQtWpBpayLGmWWZR6M= X-Google-Smtp-Source: AH8x226x0wtUIxw/IAJado2EU8uxUQzi3+GnXtJsFlySfocPxLz55gjspYCzgZ6fH4xHXG0sLK4Ohw== X-Received: by 10.80.231.6 with SMTP id a6mr19625132edn.240.1519034571358; Mon, 19 Feb 2018 02:02:51 -0800 (PST) Received: from kvdp-BRIX.cmb.citymesh.com (d515300d8.static.telenet.be. [81.83.0.216]) by smtp.googlemail.com with ESMTPSA id l60sm3942881edl.56.2018.02.19.02.02.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Feb 2018 02:02:50 -0800 (PST) From: Koen Vandeputte To: lede-dev@lists.infradead.org Date: Mon, 19 Feb 2018 11:02:45 +0100 Message-Id: <1519034565-877-1-git-send-email-koen.vandeputte@ncentric.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180219_020303_736328_9C57A6EA X-CRM114-Status: GOOD ( 10.07 ) 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:242 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] uqmi: ensure CID is a numeric value before proceeding 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: Koen Vandeputte , john@phrozen.org MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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: Koen Vandeputte --- package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 8 ++++---- 1 file changed, 4 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 c3da5ede26b1..46ea134182e3 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -140,11 +140,11 @@ proto_qmi_setup() { [ "$pdptype" = "ip" -o "$pdptype" = "ipv4v6" ] && { 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" proto_notify_error "$interface" NO_CID return 1 - } + fi uqmi -s -d "$device" --set-client-id wds,"$cid_4" --set-ip-family ipv4 > /dev/null @@ -177,11 +177,11 @@ proto_qmi_setup() { [ "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] && { 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" proto_notify_error "$interface" NO_CID return 1 - } + fi uqmi -s -d "$device" --set-client-id wds,"$cid_6" --set-ip-family ipv6 > /dev/null