public inbox for [email protected]
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <[email protected]>
To: [email protected]
Cc: [email protected], Gabriel Krisman Bertazi <[email protected]>
Subject: [PATCH liburing] test/helpers: fix socket length type
Date: Wed, 18 Jan 2023 11:48:06 -0300	[thread overview]
Message-ID: <[email protected]> (raw)

t_create_socket_pair uses size_t for paddrlen, which is uint64 on 64-bit
architecture, while the network syscalls expect uint32.  The implicit
cast is always safe for little-endian here due to the structure format,
its small size and the fact it was previously zeroed - so the test
succeeds.

Still, on BE machines, our CI caught a few tests crashing on
connect(). For instance:

localhost:~/liburing/test # ./send_recv.t
connect failed
test_invalid failed

Signed-off-by: Gabriel Krisman Bertazi <[email protected]>
---
 test/helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/helpers.c b/test/helpers.c
index 869e90342f9a..37ba67c070c8 100644
--- a/test/helpers.c
+++ b/test/helpers.c
@@ -173,7 +173,7 @@ int t_create_socket_pair(int fd[2], bool stream)
 	int val;
 	struct sockaddr_in serv_addr;
 	struct sockaddr *paddr;
-	size_t paddrlen;
+	socklen_t paddrlen;
 
 	type |= SOCK_CLOEXEC;
 	fd[0] = socket(AF_INET, type, 0);
-- 
2.35.3


             reply	other threads:[~2023-01-18 14:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 14:48 Gabriel Krisman Bertazi [this message]
2023-01-18 14:57 ` [PATCH liburing] test/helpers: fix socket length type Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox