public inbox for gwml@vger.gnuweeb.org
 help / color / mirror / Atom feed
From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
Cc: Ahmad Gani <reyuki@gnuweeb.org>,
	GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>
Subject: Re: [PATCH gwproxy v12 6/8] gwproxy: Introduce --dns-server and --raw-dns
Date: Fri, 19 Sep 2025 05:54:21 +0700	[thread overview]
Message-ID: <20250918225421.GA1128776-ammarfaizi2@gnuweeb.org> (raw)
In-Reply-To: <20250918184730.598305-7-alviro.iskandar@gnuweeb.org>

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


  reply	other threads:[~2025-09-18 22:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18 18:47 [PATCH gwproxy v12 0/8] Initial work on integration of DNS parser lib in gwproxy Alviro Iskandar Setiawan
2025-09-18 18:47 ` [PATCH gwproxy v12 1/8] gwproxy: Remove 'struct gwp_dns_query' declaration Alviro Iskandar Setiawan
2025-09-18 18:47 ` [PATCH gwproxy v12 2/8] gwproxy: Introduce __unused macro Alviro Iskandar Setiawan
2025-09-18 18:47 ` [PATCH gwproxy v12 3/8] Add DNS parser code Alviro Iskandar Setiawan
2025-09-18 18:47 ` [PATCH gwproxy v12 4/8] Add DNS resolver code Alviro Iskandar Setiawan
2025-09-18 18:47 ` [PATCH gwproxy v12 5/8] dns_resolver: Add DNS resolution interface APIs Alviro Iskandar Setiawan
2025-09-18 23:16   ` Ammar Faizi
2025-09-18 18:47 ` [PATCH gwproxy v12 6/8] gwproxy: Introduce --dns-server and --raw-dns Alviro Iskandar Setiawan
2025-09-18 22:54   ` Ammar Faizi [this message]
2025-09-18 23:07     ` Alviro Iskandar Setiawan
2025-09-18 18:47 ` [PATCH gwproxy v12 7/8] epoll: Intregrate the raw DNS feature to epoll Alviro Iskandar Setiawan
2025-09-18 18:47 ` [PATCH gwproxy v12 8/8] Makefile: Introduce --use-new-dns-resolver configure option Alviro Iskandar Setiawan
2025-09-18 18:55 ` [PATCH gwproxy v12 0/8] Initial work on integration of DNS parser lib in gwproxy Alviro Iskandar Setiawan

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=20250918225421.GA1128776-ammarfaizi2@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