Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71713C04E69 for ; Wed, 16 Aug 2023 16:03:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233062AbjHPQDT (ORCPT ); Wed, 16 Aug 2023 12:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344654AbjHPQCr (ORCPT ); Wed, 16 Aug 2023 12:02:47 -0400 Received: from orbyte.nwl.cc (orbyte.nwl.cc [IPv6:2001:41d0:e:133a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDB21272D for ; Wed, 16 Aug 2023 09:02:35 -0700 (PDT) Received: from n0-1 by orbyte.nwl.cc with local (Exim 4.94.2) (envelope-from ) id 1qWIyf-000102-6i; Wed, 16 Aug 2023 18:02:33 +0200 Date: Wed, 16 Aug 2023 18:02:33 +0200 From: Phil Sutter To: Thomas Haller Cc: NetFilter Subject: Re: [nft PATCH v4 2/6] src: add input flag NFT_CTX_INPUT_NO_DNS to avoid blocking Message-ID: Mail-Followup-To: Phil Sutter , Thomas Haller , NetFilter References: <20230803193940.1105287-1-thaller@redhat.com> <20230803193940.1105287-5-thaller@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230803193940.1105287-5-thaller@redhat.com> Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org On Thu, Aug 03, 2023 at 09:35:16PM +0200, Thomas Haller wrote: > getaddrinfo() blocks while trying to resolve the name. Blocking the > caller of the library is in many cases undesirable. Also, while > reconfiguring the firewall, it's not clear that resolving names via > the network will work or makes sense. > > Add a new input flag NFT_CTX_INPUT_NO_DNS to opt-out from getaddrinfo() > and only accept plain IP addresses. > > We could also use AI_NUMERICHOST with getaddrinfo() instead of > inet_pton(). By parsing via inet_pton(), we are better aware of > what we expect and can generate a better error message in case of > failure. > > Signed-off-by: Thomas Haller Reviewed-by: Phil Sutter