All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests: net: fix cmsg_so_mark.sh test hang
@ 2022-12-29  5:41 Po-Hsu Lin
  2022-12-30  7:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Po-Hsu Lin @ 2022-12-29  5:41 UTC (permalink / raw)
  To: netdev, linux-kernel, linux-kselftest
  Cc: davem, edumazet, kuba, pabeni, shuah, naresh.kamboju, po-hsu.lin

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 <po-hsu.lin@canonical.com>
---
 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 75dd83e..24b21b1 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) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests: net: fix cmsg_so_mark.sh test hang
  2022-12-29  5:41 [PATCH] selftests: net: fix cmsg_so_mark.sh test hang Po-Hsu Lin
@ 2022-12-30  7:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-12-30  7:40 UTC (permalink / raw)
  To: Po-Hsu Lin
  Cc: netdev, linux-kernel, linux-kselftest, davem, edumazet, kuba,
	pabeni, shuah, naresh.kamboju

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 29 Dec 2022 13:41:06 +0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - selftests: net: fix cmsg_so_mark.sh test hang
    https://git.kernel.org/netdev/net/c/1573c6882018

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-30  7:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-29  5:41 [PATCH] selftests: net: fix cmsg_so_mark.sh test hang Po-Hsu Lin
2022-12-30  7:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.