[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230307203830.612939-2-ammarfaizi2@gnuweeb.org>
Date: Wed, 8 Mar 2023 03:38:28 +0700
From: Ammar Faizi <ammarfaizi2@...weeb.org>
To: Jens Axboe <axboe@...nel.dk>
Cc: Pavel Begunkov <asml.silence@...il.com>,
io-uring Mailing List <io-uring@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Ammar Faizi <ammarfaizi2@...weeb.org>,
Dylan Yudaken <dylany@...com>
Subject: [PATCH liburing v1 1/3] io_uring-udp: Fix the wrong `inet_ntop()` argument
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 <dylany@...com>
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 <ammarfaizi2@...weeb.org>
---
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
Powered by blists - more mailing lists