From: Phil Sutter <phil@nwl.cc>
To: Thomas Haller <thaller@redhat.com>
Cc: NetFilter <netfilter-devel@vger.kernel.org>,
Pablo Neira Ayuso <pablo@netfilter.org>
Subject: Re: [nvt v3 PATCH 2/4] src: add input flag NFT_CTX_INPUT_NO_DNS to avoid blocking
Date: Thu, 27 Jul 2023 18:52:42 +0200 [thread overview]
Message-ID: <ZMKg2pzM0fhJLYZY@orbyte.nwl.cc> (raw)
In-Reply-To: <20230720143147.669250-3-thaller@redhat.com>
On Thu, Jul 20, 2023 at 04:27:01PM +0200, Thomas Haller wrote:
[...]
> diff --git a/src/datatype.c b/src/datatype.c
> index da802a18bccd..8629a38da56a 100644
> --- a/src/datatype.c
> +++ b/src/datatype.c
> @@ -599,27 +599,33 @@ static struct error_record *ipaddr_type_parse(struct parse_ctx *ctx,
> const struct expr *sym,
> struct expr **res)
> {
> - struct addrinfo *ai, hints = { .ai_family = AF_INET,
> - .ai_socktype = SOCK_DGRAM};
> - struct in_addr *addr;
> - int err;
> + struct in_addr addr;
>
> - err = getaddrinfo(sym->identifier, NULL, &hints, &ai);
> - if (err != 0)
> - return error(&sym->location, "Could not resolve hostname: %s",
> - gai_strerror(err));
> + if (ctx->input->flags & NFT_CTX_INPUT_NO_DNS) {
There are a bunch of getters defined in include/nftables.h for output
flags. I'd keep things consistent by introducing the same for input
flags, so the above becomes 'if (nft_input_no_dns(ctx->input))'.
In this spot it doesn't quite matter, but in the next patch you
introduce mixed use of a getter (for output flags) and the binary op as
seen here which is confusing.
Cheers, Phil
next prev parent reply other threads:[~2023-07-27 16:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 14:26 [nft v3 PATCH 0/4] add input flags and "no-dns"/"json" flags Thomas Haller
2023-07-20 14:27 ` [nft v3 PATCH 1/4] src: add input flags for nft_ctx Thomas Haller
2023-07-20 14:27 ` [nvt v3 PATCH 2/4] src: add input flag NFT_CTX_INPUT_NO_DNS to avoid blocking Thomas Haller
2023-07-27 16:52 ` Phil Sutter [this message]
2023-07-20 14:27 ` [nft v3 PATCH 3/4] src: add input flag NFT_CTX_INPUT_JSON to enable JSON parsing Thomas Haller
2023-07-27 16:57 ` Phil Sutter
2023-07-20 14:27 ` [nft v3 PATCH 4/4] py: add Nftables.input_{set,get}_flags() API Thomas Haller
2023-07-27 17:02 ` Phil Sutter
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=ZMKg2pzM0fhJLYZY@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=thaller@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).