From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server-vie001.gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=new2025; t=1754516030; bh=sYbhVLo80w1jcJWdRtJi6RfGMPzdpUzo+1S/gX5z5ek=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To:Message-ID:Date:From:Reply-To:Subject:To: Cc:In-Reply-To:References:Resent-Date:Resent-From:Resent-To: Resent-Cc:User-Agent:Content-Type:Content-Transfer-Encoding; b=Hqh8BDF7k3ujy0ZtRmvGOTLowmMaURlERXFj1TwPf4IhVvJuTsW308zlaHYWsOqP/ SnpwHCVfA7RqC8Q7ga4gwVjGyWWTtBuSxATXQ3Ys9rKsHEdRRI1QbnOcsLHB1JNZit pT73BsX2o/ELa0mdMFO3sOCMRi/kHkkFh5U9GxzxnXxyqaEmgn5KbzNRLY7NTD3OCA KoNQsa34zyq9viGFC0z1KC8g8lAsdb7YJpBh6FzFKgdAXKGGqun7cAOa56oK3NkrBo ghxLLV+TVsLXh/HJLheP5/xCnFAIPMEwA0FEnqkODJ7zQ7GH9a92fQ533SUsNOhiCp aauwxyTKMIK6A== Received: from linux.gnuweeb.org (unknown [182.253.126.229]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id E16E63127C07; Wed, 6 Aug 2025 21:33:49 +0000 (UTC) Date: Thu, 7 Aug 2025 04:33:46 +0700 From: Ammar Faizi To: Ahmad Gani Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: Re: [PATCH gwproxy v4 4/6] dnslookup: Initial work for implementation of C-ares-like getaddrinfo function Message-ID: References: <20250806035727.216702-1-reyuki@gnuweeb.org> <20250806035727.216702-5-reyuki@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Machine-Hash: hUx9VaHkTWcLO7S8CQCslj6OzqBx2hfLChRz45nPESx5VSB/xuJQVOKOB1zSXE3yc9ntP27bV1M1 List-Id: 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