public inbox for [email protected]
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Pavel Begunkov <[email protected]>,
	io-uring Mailing List <[email protected]>,
	Linux Kernel Mailing List <[email protected]>,
	Ammar Faizi <[email protected]>,
	Dylan Yudaken <[email protected]>
Subject: [PATCH liburing v1 1/3] io_uring-udp: Fix the wrong `inet_ntop()` argument
Date: Wed,  8 Mar 2023 03:38:28 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

The verbose output shows the wrong IP address. The second argument of
inet_ntop() should be a pointer to the binary representation of the IP
address. Fix it.

Reported-by: @mczka # A GitHub user
Cc: Dylan Yudaken <[email protected]>
Closes: https://github.com/axboe/liburing/pull/815
Fixes: https://github.com/axboe/liburing/issues/814
Fixes: 61d472b51e761e61c ("add an example for a UDP server")
Signed-off-by: Ammar Faizi <[email protected]>
---
 examples/io_uring-udp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/io_uring-udp.c b/examples/io_uring-udp.c
index a07c3e2a6f20cd17..b81a5e7c47afd9c8 100644
--- a/examples/io_uring-udp.c
+++ b/examples/io_uring-udp.c
@@ -275,7 +275,7 @@ static int process_cqe_recv(struct ctx *ctx, struct io_uring_cqe *cqe,
 		const char *name;
 		struct sockaddr_in *addr = io_uring_recvmsg_name(o);
 
-		name = inet_ntop(ctx->af, addr, buff, sizeof(buff));
+		name = inet_ntop(ctx->af, &addr->sin_addr, buff, sizeof(buff));
 		if (!name)
 			name = "<INVALID>";
 		fprintf(stderr, "received %u bytes %d from %s:%d\n",
-- 
Ammar Faizi


  reply	other threads:[~2023-03-07 20:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 20:38 [PATCH liburing v1 0/3] Small fixes and CI update Ammar Faizi
2023-03-07 20:38 ` Ammar Faizi [this message]
2023-03-07 20:38 ` [PATCH liburing v1 2/3] github: Append `-Wno-sign-compare` to the GitHub build bot CFLAGS Ammar Faizi
2023-03-07 20:38 ` [PATCH liburing v1 3/3] man/io_uring_register_{buffers,files}: Kill trailing whitespaces Ammar Faizi
2023-03-07 20:55 ` [PATCH liburing v1 0/3] Small fixes and CI update 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] \
    [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