From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: Ahmad Gani <reyuki@gnuweeb.org>
Cc: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>,
GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>
Subject: Re: [PATCH gwproxy v4 4/6] dnslookup: Initial work for implementation of C-ares-like getaddrinfo function
Date: Thu, 7 Aug 2025 04:33:46 +0700 [thread overview]
Message-ID: <aJPKOlo7CC1JB3Ia@linux.gnuweeb.org> (raw)
In-Reply-To: <CAADvAgpM5+4zenkwD1PkmuiOJY8Vc2zT1bsc8EvOfLpF+LZVgw@mail.gmail.com>
On Wed, Aug 06, 2025 at 07:30:08PM +0700, Ahmad Gani wrote:
> Well, dnsparser.c contains pure byte parsing code, so you might want to
> take a look there.
That part is good. You're half way to get there. But that parser doesn't
provide all necessary parts to resolve a domain.
The problem with the current design is the primary interfaces you
provide. They are gw_ares_init(), gw_ares_getaddrinfo(), etc. Those
things do 'full networking setup' which is not suitable for io_uring
pattern.
Let's make a simple rule. No syscalls in the DNS library. An exception
maybe reading /etc/hosts, but you can skip that part for now.
The DNS lib should at least accept:
- Domain name.
- Service name (port).
- Address families to be resolved (AF_INET or AF_INET6).
- Received bytes from the network.
- Pointer to recv and send buffer (including their lengths).
The DNS lib should at least generate:
- Resolved addresses in 'struct gwp_sockaddr' form.
- Bytes to be sent to the network.
If you provide such interfaces, it can be integrated with all networking
patterns. And that's what we're trying to achieve by inventing our own
library.
I didn't catch this mistake earlier because I only skimmed the code.
Thanks to Alviro for pointing it out yesterday.
You should also now realize that your "gw_ares" design is not compatible
with prep_{recv,send} calls from io_uring. Right?
--
Ammar Faizi
next prev parent reply other threads:[~2025-08-06 21:33 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-06 3:57 [PATCH gwproxy v4 0/6] Initial work for DNS lookup implementation Ahmad Gani
2025-08-06 3:57 ` [PATCH gwproxy v4 1/6] dnslookup: Split common functionality and struct into net.h and net.c Ahmad Gani
2025-08-06 6:18 ` Alviro Iskandar Setiawan
2025-08-06 3:57 ` [PATCH gwproxy v4 2/6] dnslookup: Add a new parameter default_port Ahmad Gani
2025-08-06 6:20 ` Alviro Iskandar Setiawan
2025-08-06 3:57 ` [PATCH gwproxy v4 3/6] dnslookup: Allow only port string number Ahmad Gani
2025-08-06 3:57 ` [PATCH gwproxy v4 4/6] dnslookup: Initial work for implementation of C-ares-like getaddrinfo function Ahmad Gani
2025-08-06 6:40 ` Alviro Iskandar Setiawan
2025-08-06 6:51 ` Alviro Iskandar Setiawan
2025-08-06 8:43 ` Ahmad Gani
2025-08-06 8:40 ` Ahmad Gani
2025-08-06 11:09 ` Alviro Iskandar Setiawan
2025-08-06 11:20 ` Alviro Iskandar Setiawan
2025-08-06 11:39 ` Ammar Faizi
2025-08-06 12:30 ` Ahmad Gani
2025-08-06 20:54 ` Ammar Faizi
2025-08-06 12:30 ` Ahmad Gani
2025-08-06 21:33 ` Ammar Faizi [this message]
2025-08-14 4:54 ` Ahmad Gani
2025-08-06 3:57 ` [PATCH gwproxy v4 5/6] dnsparser: Transaction id creation is delegated to caller Ahmad Gani
2025-08-06 6:28 ` Alviro Iskandar Setiawan
2025-08-06 10:20 ` Ahmad Gani
2025-08-06 10:51 ` Alviro Iskandar Setiawan
2025-08-06 12:29 ` Ahmad Gani
2025-08-06 3:57 ` [PATCH gwproxy v4 6/6] dnslookup: Make gw_ares_getaddrinfo asynchronous Ahmad Gani
2025-08-06 6:22 ` Alviro Iskandar Setiawan
2025-08-06 8:42 ` Ahmad Gani
2025-08-06 7:03 ` [PATCH gwproxy v4 0/6] Initial work for DNS lookup implementation Ammar Faizi
2025-08-06 7:08 ` Ammar Faizi
2025-08-06 8:37 ` Ahmad Gani
2025-08-06 8:58 ` Ammar Faizi
2025-08-06 9:47 ` Ammar Faizi
2025-08-06 20:50 ` Ammar Faizi
2025-08-06 22:14 ` Ammar Faizi
2025-08-06 7:08 ` (subset) " Ammar Faizi
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 \
--in-reply-to=aJPKOlo7CC1JB3Ia@linux.gnuweeb.org \
--to=ammarfaizi2@gnuweeb.org \
--cc=alviro.iskandar@gnuweeb.org \
--cc=gwml@vger.gnuweeb.org \
--cc=reyuki@gnuweeb.org \
/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