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=1758236065; bh=i9W1cKryCfh/xvmZxUGLi14p0VGfFLoxh9lT9K0gdZM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To:X-Gw-Outgoing-Server-Hash:X-Gw-Message-ID: X-Gw-PM-Hash: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=qjmRkFRKGVopBCgfCv5gE47dtyL/WpZ1qAMBBFnsfwgKOTVFgTlRE35+4FFjhxTMm K79I7OqtABUtM3+RzZ7+B5O9B1qWZJhwUHoO3OkijsasMVbPeyLSULpEf8whVNw5/k 4enj5JjnuXzBo5BT/BdMhxgSWF32uHKuMZtnHvZn1PuPomS3n6Oxqx2HSn/pm1R0OS IYXs5XaIR2zzhqOiz13dumMZx5XPgFHALObWuuxtHYuLtOORu1/VsqEuYBOG08DcfN Ucz9XUrGud+ER3LT4ngAmKApKJKOLM0GJnRdB73xI8ndbIkoaewmTNAaqk2z+ImeOE BRv11TGjd68mQ== Received: from linux.gnuweeb.org (unknown [182.253.126.210]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id 5E1AB312799D; Thu, 18 Sep 2025 22:54:24 +0000 (UTC) Date: Fri, 19 Sep 2025 05:54:21 +0700 From: Ammar Faizi To: Alviro Iskandar Setiawan Cc: Ahmad Gani , GNU/Weeb Mailing List Subject: Re: [PATCH gwproxy v12 6/8] gwproxy: Introduce --dns-server and --raw-dns Message-ID: <20250918225421.GA1128776-ammarfaizi2@gnuweeb.org> References: <20250918184730.598305-1-alviro.iskandar@gnuweeb.org> <20250918184730.598305-7-alviro.iskandar@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250918184730.598305-7-alviro.iskandar@gnuweeb.org> X-Gw-Outgoing-Server-Hash: 01afd303c8b96d0c1d5e80aa96a4ee40ec69888f786fa24107c0862c0644af79 X-Gw-Message-ID: b64afcff65c65c22ec7169e5a0b5392a8ec18c5cc769b90d367d92e35f38c720 X-Gw-PM-Hash: 80794a19b718d00f3581a5f5cff20e9db484e58a1f9d25a9853e2541b6e884b5 List-Id: On Fri, Sep 19, 2025 at 01:47:28AM +0700, Alviro Iskandar Setiawan wrote: > While in there, plug the new DNS resolver data structure into struct > gwp_wrk and initialize it. I don't see any guard against the io_uring usage. Note that you only add this feature support for epoll. Did you test and verify that your feature addition doesn't break the io_uring event loop? > @@ -228,6 +238,12 @@ static int parse_options(int argc, char *argv[], struct gwp_cfg *cfg) > case 'p': > cfg->pid_file = optarg; > break; > + case 'j': > + cfg->dns_servers = optarg; > + break; > + case 'r': > + cfg->use_raw_dns = !!atoi(optarg); > + break; > default: > fprintf(stderr, "Unknown option: %c\n", c); > show_help(argv[0]); Maybe you can add: if (cfg->use_raw_dns && !strcmp(cfg->event_loop, "io_uring)) { fprintf(stderr, ERR_WRAP "Error: The raw DNS feature is currently not supported with the io_uring event loop\n" ERR_WRAP); goto einval; } or something similar to avoid io_uring being run with the experimental feature that's not available for it yet. > + > + if (cfg->use_raw_dns) { > + r = gwp_ctx_init_raw_dns(w); > + if (r < 0) { > + pr_err(&ctx->lh, "Failed to initialize raw DNS: %s", strerror(-r)); > + goto out_err; > + } > + } The problem with this initialization is that, it does not take care of the io_uring case. It'll probably crash as the io_uring code still thinks it's allowed to use ctx->dns. -- Ammar Faizi