From patchwork Thu Oct 8 12:35:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Richard X-Patchwork-Id: 1378544 X-Patchwork-Delegate: daniel@makrotopia.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kontron.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=Jo8tro6v; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mysnt.onmicrosoft.com header.i=@mysnt.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-mysnt-onmicrosoft-com header.b=lFIPe2yV; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C6W1Z55qGz9ryj for ; Thu, 8 Oct 2020 23:37:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=BwM4fla/OdjsJRSmftAsAPA2y9yf/U/dxUkE0T0rz20=; b=Jo8tro6vrEXbVDy5898Kdn+T2l fLgeG5UA19WXPxGiZa8zrSuRWQ02emsVYzYWTJx3C3EaorM8E3e4teFQkLFWQs9oJQqhKF2W/Ve5s bnX2XBG2aSiNtLw/Zaoakkl2UVaM+10yWvqVkToOccZhqwB1r3VNljhV+zbwugLs1KWE2mkqHJR53 IyKsW/2qO65uE/pjpZh/suv8WAXQF18haWhqtDeYEL3sl3nAyPEJ+uj2LOy6RfC2a/9n8wc+qqPP2 xRcrp7s7rVomupvhlRWPrDkTVdvzqL5rvk2n4s4pE7XzKNgLyAtJ1BRojdu0aFc9+luas6xTU5OcL zH+qaMgQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQV9L-0002oL-8Q; Thu, 08 Oct 2020 12:35:59 +0000 Received: from mail-eopbgr00127.outbound.protection.outlook.com ([40.107.0.127] helo=EUR02-AM5-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQV9I-0002nT-N4 for openwrt-devel@lists.openwrt.org; Thu, 08 Oct 2020 12:35:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XoaZF437tghA1cFHd6ee26c0ymZ66pEEOQ6E0Z6WKXqvmLwRzgfruFKmp3fmdnJ09OdmsEkBqkUn4eKMzxxajXrK9UT0F3MEX+rgtQODG8iXKkUkv0kcKrwVS74QPLaDRmoJUSEcuFZlVzWPYxkuKXtd/1q6MYFoC8zbl+fKGxpG0+IQaGm55j+8SJqsEpWA7CqDC0EjdUA6oHyrrkqEIRqbAOzKHshac8Tuj3Zg9KIfy9QQXzLvE9UQ/RPE7eAogoObZ25XiwD0NCxn2tJ67OL8xajfGhPWeUeDJ5GHuP8YZEhd3FGQ/9fy+cI4fVtWhpo/4qeGw1wljiJXVN12OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gKfnC+5BLBjfcR5v8qqTsEE8a0Q/vKxwVF6MKAFPPFI=; b=iyoijsp/8OPqepuOWHubC1Bx1+mA5D5LU7BUtYutryarcLZg+7Nkz9IUnGtXhgxCotsYKbpcfL3ISNrvHb6K4HDcIIoXRvaeya9kLIyPJnzBnZt2n0/20LrECYc2mGMZQ785CxaJQYWT2mkH8Cbaw3m7zGDHKkNTXkAJHuzOhnZtcDy5RG8UgztesFnavVODMfkQNy+LAvXGjcBXbbAqEjOVo036VMeqYsgDEd5WfxvOXUSUe46VwO6jS6XEoTWtidv/vxVLVNMZJBt1ogcAARJbG79SVfZO3S1XszBmxlxF02Kz6d2h+GDaPsoHpHAan862fcCMKYf5OE8One95fg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kontron.com; dmarc=pass action=none header.from=kontron.com; dkim=pass header.d=kontron.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mysnt.onmicrosoft.com; s=selector2-mysnt-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gKfnC+5BLBjfcR5v8qqTsEE8a0Q/vKxwVF6MKAFPPFI=; b=lFIPe2yVxjNY8TgETg2t6pRZbIMoiL/Kz908daVC1ZQzW87f3VwD+KR/jNnCn7/iXvipWZQDcjr/dxliAMLyJS6kciC6jekxtl+E/xTVYnj40Uk5KqUJw6iuC13cEbN2zwO/IWFtxdJSQ7oaHkwhyJcSxJ1UibXeXrmR22iIkPg= Authentication-Results: elisanet.fi; dkim=none (message not signed) header.d=none;elisanet.fi; dmarc=none action=none header.from=kontron.com; Received: from DB8PR10MB3275.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:118::12) by DB8PR10MB2779.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:b1::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.22; Thu, 8 Oct 2020 12:35:52 +0000 Received: from DB8PR10MB3275.EURPRD10.PROD.OUTLOOK.COM ([fe80::589:33d6:c1e9:1b67]) by DB8PR10MB3275.EURPRD10.PROD.OUTLOOK.COM ([fe80::589:33d6:c1e9:1b67%5]) with mapi id 15.20.3433.045; Thu, 8 Oct 2020 12:35:52 +0000 From: Thomas Richard To: malaakso@elisanet.fi Subject: [PATCH] uqmi: wait forever registration if timeout set to 0 Date: Thu, 8 Oct 2020 14:35:24 +0200 Message-Id: <20201008123524.698-1-thomas.richard@kontron.com> X-Mailer: git-send-email 2.11.0 X-Originating-IP: [217.109.32.205] X-ClientProxiedBy: PR0P264CA0227.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1e::23) To DB8PR10MB3275.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:118::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pclinuxtrichard.kvm.meltem (217.109.32.205) by PR0P264CA0227.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21 via Frontend Transport; Thu, 8 Oct 2020 12:35:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f4d0e505-5d47-474a-513f-08d86b86b168 X-MS-TrafficTypeDiagnostic: DB8PR10MB2779: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:431; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: umnvgiTaOZ1hEvJavG0ZX7Gx2vM4BZWEqZ/uFrDOMkpw/EXRnn6S4JhXXjgIC5fMgCh5+DRvfQb88RDMRVfYDCtrEYUU3krdDeI8LUb8HcT0o2qOI71gJZ13D/ehP4HyN2KTw6do4NqXolY5+i7Q6qPM8fN0WGUFCpbUWQxPpsyBRaQ5DmbwXMykcfUrNkT066IQu2DOaL6MoUhIHT7sNKPMzVos46LLfJk5xjWkfebi2CDGbtpw7+/AcAC9CFHrQe2xJoCnAPUIv5kzX3O+/wM1hCxx90Lc0qipCfINyNlCGZ70Oao6nkIGOH9ZzatCKbJWr/IbrFemWXmE759KSQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR10MB3275.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(4636009)(346002)(376002)(39860400002)(136003)(396003)(366004)(6512007)(186003)(6666004)(16526019)(83380400001)(316002)(52116002)(5660300002)(2906002)(44832011)(2616005)(66476007)(956004)(66946007)(66556008)(6506007)(86362001)(6916009)(36756003)(8676002)(26005)(1076003)(6486002)(8936002)(478600001)(4326008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: JqvL+nqlXS2nXQlRvyefVWgD4g+m1iBhHnXZYPPx6K1uYyWNu9AdfBKiPgbd9xFIQfD5WMQbgK2qgxVBgB+4IVd/0/D5Ja07f/sLTTzVbMxtRj8MkCeRyBq9ijpMVXYmU3HBReKP2eCc2nw9ntaTrwk2qQcQS5yoHTV5ckZGY3xIBWuh6g/o2JuRqm3kmHSSYMzuPmupQSh8MDczB6wGXxJUnovhQxvKYue1C3JSVFGdKeXpcGO51oREIAVf8x0WFdpxdUqZe9WHLgPEEW5WUjdKzZYdsw0jg4aCrQhyPSOuU2biB7XH98+RsXSol8e953ZfIZBlVIJh1jXGThJEc6SzwxSs7a0HY9ldOV2ZXyCHDLE9zgXeb6DfmQ4rgoeIo+iQwV17Yd6IXx9TANjJ+hMNbZaT2IvRy+iszw2SNhZ/XYLQGW7Nm6dtLD55hODyxqyFaYpU+Pbb9R7qLW17uQIikE4L9AQdrXSqZwuxLo2XlGiuE5nOzxjuTuGIvuqlcDClZ2orADdE6m2HNqLeVXAh6xV3w7YTW3mQ8zF4kCMdJOrKNn/jB/PrgSjZtMFwZ5rVnZZzlXZiHZppAvv0KoC3I5FOKOc/3F/tS5gfS7HrQarGXBBZfTTtEwc54HU5JIGolHHVXMCIVoLS+ylkYA== X-OriginatorOrg: kontron.com X-MS-Exchange-CrossTenant-Network-Message-Id: f4d0e505-5d47-474a-513f-08d86b86b168 X-MS-Exchange-CrossTenant-AuthSource: DB8PR10MB3275.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2020 12:35:52.1597 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8c9d3c97-3fd9-41c8-a2b1-646f3942daf1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PUIt8FyxWUG0/9Fv52NxSCsIAhIDjKTAhXhJNWy8iojU3jJ/vV5D4FuLQF8JYKoRuJBwSlDFgrAmnGt89JAO/jDnocN7oJRn1A648KRM8gg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR10MB2779 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201008_083556_870529_E6840EEA X-CRM114-Status: GOOD ( 15.16 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [40.107.0.127 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.0.127 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -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.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Richard , openwrt-devel@lists.openwrt.org Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Give possibility to wait forever the registration by setting timeout option to 0. No timeout can be useful if the interface starts whereas no network is available, because at the end of timeout the interface will be stopped and never restarted. Signed-off-by: Thomas Richard --- package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 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 8cbe9e97e7..31c2656142 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -82,7 +82,7 @@ proto_qmi_setup() { local uninitialized_timeout=0 while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do [ -e "$device" ] || return 1 - if [ "$uninitialized_timeout" -lt "$timeout" ]; then + if [ "$uninitialized_timeout" -lt "$timeout" -o "$timeout" = "0" ]; then let uninitialized_timeout++ sleep 1; else @@ -195,7 +195,7 @@ proto_qmi_setup() { local registration_timeout=0 while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do [ -e "$device" ] || return 1 - if [ "$registration_timeout" -lt "$timeout" ]; then + if [ "$registration_timeout" -lt "$timeout" -o "$timeout" = "0" ]; then let registration_timeout++ sleep 1; else