From patchwork Tue Jan 17 10:58:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1727497 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=jEcY+Bd5; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nx5WF51PZz23gH for ; Tue, 17 Jan 2023 21:59:36 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pHjgc-0004ci-OH; Tue, 17 Jan 2023 10:59:26 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pHjga-0004cS-Tv for kernel-team@lists.ubuntu.com; Tue, 17 Jan 2023 10:59:24 +0000 Received: from localhost.localdomain (1.general.phlin.uk.vpn [10.172.194.38]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 1D22B43812 for ; Tue, 17 Jan 2023 10:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1673953163; bh=H1FmMQLrTdQzxyxiaRc/eSykUe/KayD/2sqlXLkDvOU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jEcY+Bd5wZ3PhInMhT+jv0x+OCTee5z7psX6e3gfw7NOpvGtHHo7vUZKV4P09QDHm eJ48/HvQ69HCLRpudnWpXaoK1P2ipkKdygm1Sj4uJYNPGs51m90WdO5v49StvNj4B2 7jmRz4jrNyT6rCFaexnoZaP+KNH3OSwUkNuWVe30XKmDp/g/deg2v/X6dHfSGATole 7szVDs8Qdz6tte9O/5EfznU1YJ76VW6BTBFG1hD9mN/akBvow9xeEONqh0qNJM+m9v glTPZcSyzOq3h64XoIQ7Ed851UVWmbpKj0/XykUnqEt68Gns5RBU11fcPorAGpYB0c 60DUF7I2fgkkQ== From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [K][L][SRU][PATCH 1/1] selftests: net: fix cmsg_so_mark.sh test hang Date: Tue, 17 Jan 2023 18:58:32 +0800 Message-Id: <20230117105832.74038-2-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230117105832.74038-1-po-hsu.lin@canonical.com> References: <20230117105832.74038-1-po-hsu.lin@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2000667 This cmsg_so_mark.sh test will hang on non-amd64 systems because of the infinity loop for argument parsing in cmsg_sender. Variable "o" in cs_parse_args() for taking getopt() should be an int, otherwise it will be 255 when getopt() returns -1 on non-amd64 system and thus causing infinity loop. Link: https://lore.kernel.org/lkml/CA+G9fYsM2k7mrF7W4V_TrZ-qDauWM394=8yEJ=-t1oUg8_40YA@mail.gmail.com/t/ Signed-off-by: Po-Hsu Lin Signed-off-by: David S. Miller (cherry picked from commit 1573c6882018f69991aead951d09423ce978adac) Signed-off-by: Po-Hsu Lin --- tools/testing/selftests/net/cmsg_sender.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/cmsg_sender.c b/tools/testing/selftests/net/cmsg_sender.c index bc21629..31ac729 100644 --- a/tools/testing/selftests/net/cmsg_sender.c +++ b/tools/testing/selftests/net/cmsg_sender.c @@ -110,7 +110,7 @@ static void __attribute__((noreturn)) cs_usage(const char *bin) static void cs_parse_args(int argc, char *argv[]) { - char o; + int o; while ((o = getopt(argc, argv, "46sS:p:m:M:d:tf:F:c:C:l:L:H:")) != -1) { switch (o) {