From patchwork Fri Oct 1 17:41:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1535456 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=azazel.net header.i=@azazel.net header.a=rsa-sha256 header.s=20190108 header.b=X+bFOUvS; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HLcwB0VxNz9t1C for ; Sat, 2 Oct 2021 03:45:46 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355264AbhJARrY (ORCPT ); Fri, 1 Oct 2021 13:47:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbhJARrY (ORCPT ); Fri, 1 Oct 2021 13:47:24 -0400 Received: from kadath.azazel.net (kadath.azazel.net [IPv6:2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E438C06177D for ; Fri, 1 Oct 2021 10:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20190108; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=64STmJf6oBXBeftc8t2ERVuWNqZ3ShHvBTMiDn6hAH8=; b=X+bFOUvS9puY0YFPZG/CV/88K0 EbaJ9/YblfKa0pXNZTVaMPHfAbXMFiU5wvKYF7RqMpEaLKopK+5IewORxTjlppfl28rlHsf6WQhIW 6qiKDdldNS+/7bPz17uwL4p8WetasifW17kzccTBn65USpptzB8+LJ0K+wl7WaXvFPlk5W4MSlbdG BrpNGElC0LsAc404syCsRxzkfFThvuzUI3fnBlPG66aKk8q64IhWnUll6H8mZZskViRMNQtgabKHg gp3Bu2p9kEUTqq07Od5FeysQBqtgAqagZ21uNeHLjlPROaAC6N+zLaPcE3o7vHOoRIY9TCfzEqQ3u kTaSGbWQ==; Received: from ulthar.dreamlands.azazel.net ([2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae]) by kadath.azazel.net with esmtp (Exim 4.94.2) (envelope-from ) id 1mWMbF-002RLP-MT; Fri, 01 Oct 2021 18:45:33 +0100 From: Jeremy Sowden To: Netfilter Devel Cc: Kyle Bowman , Alex Forster , Cloudflare Kernel Team Subject: [PATCH iptables v2 1/8] nft: fix indentation error. Date: Fri, 1 Oct 2021 18:41:35 +0100 Message-Id: <20211001174142.1267726-2-jeremy@azazel.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001174142.1267726-1-jeremy@azazel.net> References: <20211001174142.1267726-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on kadath.azazel.net); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org `add_action` was indented with 7 spaces. Signed-off-by: Jeremy Sowden --- iptables/nft.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/iptables/nft.c b/iptables/nft.c index dc1f5160eb98..5613bc968046 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -1320,27 +1320,27 @@ int add_verdict(struct nftnl_rule *r, int verdict) int add_action(struct nftnl_rule *r, struct iptables_command_state *cs, bool goto_set) { - int ret = 0; - - /* If no target at all, add nothing (default to continue) */ - if (cs->target != NULL) { - /* Standard target? */ - if (strcmp(cs->jumpto, XTC_LABEL_ACCEPT) == 0) - ret = add_verdict(r, NF_ACCEPT); - else if (strcmp(cs->jumpto, XTC_LABEL_DROP) == 0) - ret = add_verdict(r, NF_DROP); - else if (strcmp(cs->jumpto, XTC_LABEL_RETURN) == 0) - ret = add_verdict(r, NFT_RETURN); - else - ret = add_target(r, cs->target->t); - } else if (strlen(cs->jumpto) > 0) { - /* Not standard, then it's a go / jump to chain */ - if (goto_set) - ret = add_jumpto(r, cs->jumpto, NFT_GOTO); - else - ret = add_jumpto(r, cs->jumpto, NFT_JUMP); - } - return ret; + int ret = 0; + + /* If no target at all, add nothing (default to continue) */ + if (cs->target != NULL) { + /* Standard target? */ + if (strcmp(cs->jumpto, XTC_LABEL_ACCEPT) == 0) + ret = add_verdict(r, NF_ACCEPT); + else if (strcmp(cs->jumpto, XTC_LABEL_DROP) == 0) + ret = add_verdict(r, NF_DROP); + else if (strcmp(cs->jumpto, XTC_LABEL_RETURN) == 0) + ret = add_verdict(r, NFT_RETURN); + else + ret = add_target(r, cs->target->t); + } else if (strlen(cs->jumpto) > 0) { + /* Not standard, then it's a go / jump to chain */ + if (goto_set) + ret = add_jumpto(r, cs->jumpto, NFT_GOTO); + else + ret = add_jumpto(r, cs->jumpto, NFT_JUMP); + } + return ret; } static void nft_rule_print_debug(struct nftnl_rule *r, struct nlmsghdr *nlh) From patchwork Fri Oct 1 17:41:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1535458 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=azazel.net header.i=@azazel.net header.a=rsa-sha256 header.s=20190108 header.b=ZYBkm57M; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HLcwB5QG5z9t0k for ; Sat, 2 Oct 2021 03:45:46 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355106AbhJARrZ (ORCPT ); Fri, 1 Oct 2021 13:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355123AbhJARrY (ORCPT ); Fri, 1 Oct 2021 13:47:24 -0400 Received: from kadath.azazel.net (kadath.azazel.net [IPv6:2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E493C06177E for ; Fri, 1 Oct 2021 10:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20190108; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qvM2AYsBThgn0GREf1z5XcFC3BbKJgT6ntXsns8gC6c=; b=ZYBkm57MGS+AD3BmHCO5/2SljN /t6GE/J1wd+DadOrxgJAnrTVxOIiLuiaB4k6qb4huLexqN8AsR4Xr79bJgD+C2xn96cNLlNVH6i6I BiBjSbi1GBSbl+JZhGDZ132N4aLxeCqwukCBmx5PfcA25rAmcfIQQQlOWl9kQULvPDk+o48/fI7gL 6ZSz1RZg4oi2iApsdQnyLziFSZYoxxjqH7vBDtqIsHJSISri2HIDXHoAAuqBZ+C7ARhdM1oqcA+PO MbpvTrASLBcIc7Le8/JH0fuySd3MbnNCdtgk1mRADPIGEkasHXUhhrkTI+zh8Sty403v7PrORJyiv 3jcqjAXA==; Received: from ulthar.dreamlands.azazel.net ([2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae]) by kadath.azazel.net with esmtp (Exim 4.94.2) (envelope-from ) id 1mWMbF-002RLP-V8; Fri, 01 Oct 2021 18:45:34 +0100 From: Jeremy Sowden To: Netfilter Devel Cc: Kyle Bowman , Alex Forster , Cloudflare Kernel Team Subject: [PATCH iptables v2 2/8] extensions: libxt_NFLOG: use nft built-in logging instead of xt_NFLOG Date: Fri, 1 Oct 2021 18:41:36 +0100 Message-Id: <20211001174142.1267726-3-jeremy@azazel.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001174142.1267726-1-jeremy@azazel.net> References: <20211001174142.1267726-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on kadath.azazel.net); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org From: Kyle Bowman Replaces the use of xt_NFLOG with the nft built-in log statement. This additionally adds support for using longer log prefixes of 128 characters in size. Until now NFLOG has truncated the log-prefix to the 64-character limit supported by iptables-legacy. We now use the struct xtables_target's udata member to store the longer 128-character prefix supported by iptables-nft. Signed-off-by: Kyle Bowman Signed-off-by: Alex Forster Signed-off-by: Jeremy Sowden --- extensions/libxt_NFLOG.c | 6 ++++++ iptables/nft.c | 28 ++++++++++++++++++++++++++++ iptables/nft.h | 1 + 3 files changed, 35 insertions(+) diff --git a/extensions/libxt_NFLOG.c b/extensions/libxt_NFLOG.c index 02a1b4aa35a3..2b78e27808f8 100644 --- a/extensions/libxt_NFLOG.c +++ b/extensions/libxt_NFLOG.c @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -53,12 +54,16 @@ static void NFLOG_init(struct xt_entry_target *t) static void NFLOG_parse(struct xt_option_call *cb) { + char *nf_log_prefix = cb->udata; + xtables_option_parse(cb); switch (cb->entry->id) { case O_PREFIX: if (strchr(cb->arg, '\n') != NULL) xtables_error(PARAMETER_PROBLEM, "Newlines not allowed in --log-prefix"); + + snprintf(nf_log_prefix, NF_LOG_PREFIXLEN, "%s", cb->arg); break; } } @@ -149,6 +154,7 @@ static struct xtables_target nflog_target = { .save = NFLOG_save, .x6_options = NFLOG_opts, .xlate = NFLOG_xlate, + .udata_size = NF_LOG_PREFIXLEN }; void _init(void) diff --git a/iptables/nft.c b/iptables/nft.c index 5613bc968046..53506c9475c0 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -1331,6 +1332,8 @@ int add_action(struct nftnl_rule *r, struct iptables_command_state *cs, ret = add_verdict(r, NF_DROP); else if (strcmp(cs->jumpto, XTC_LABEL_RETURN) == 0) ret = add_verdict(r, NFT_RETURN); + else if (strcmp(cs->jumpto, "NFLOG") == 0) + ret = add_log(r, cs); else ret = add_target(r, cs->target->t); } else if (strlen(cs->jumpto) > 0) { @@ -1343,6 +1346,31 @@ int add_action(struct nftnl_rule *r, struct iptables_command_state *cs, return ret; } +int add_log(struct nftnl_rule *r, struct iptables_command_state *cs) +{ + struct nftnl_expr *expr; + struct xt_nflog_info *info = (struct xt_nflog_info *)cs->target->t->data; + + expr = nftnl_expr_alloc("log"); + if (!expr) + return -ENOMEM; + + if (info->prefix[0] != '\0') + nftnl_expr_set_str(expr, NFTNL_EXPR_LOG_PREFIX, + cs->target->udata); + + nftnl_expr_set_u16(expr, NFTNL_EXPR_LOG_GROUP, info->group); + if (info->flags & XT_NFLOG_F_COPY_LEN) + nftnl_expr_set_u32(expr, NFTNL_EXPR_LOG_SNAPLEN, + info->len); + if (info->threshold) + nftnl_expr_set_u16(expr, NFTNL_EXPR_LOG_QTHRESHOLD, + info->threshold); + + nftnl_rule_add_expr(r, expr); + return 0; +} + static void nft_rule_print_debug(struct nftnl_rule *r, struct nlmsghdr *nlh) { #ifdef NLDEBUG diff --git a/iptables/nft.h b/iptables/nft.h index ef79b018f783..440b23af68df 100644 --- a/iptables/nft.h +++ b/iptables/nft.h @@ -194,6 +194,7 @@ int add_match(struct nft_handle *h, struct nftnl_rule *r, struct xt_entry_match int add_target(struct nftnl_rule *r, struct xt_entry_target *t); int add_jumpto(struct nftnl_rule *r, const char *name, int verdict); int add_action(struct nftnl_rule *r, struct iptables_command_state *cs, bool goto_set); +int add_log(struct nftnl_rule *r, struct iptables_command_state *cs); char *get_comment(const void *data, uint32_t data_len); enum nft_rule_print { From patchwork Fri Oct 1 17:41:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1535461 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=azazel.net header.i=@azazel.net header.a=rsa-sha256 header.s=20190108 header.b=lJlgBOHC; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HLcwC5TH5z9t1C for ; Sat, 2 Oct 2021 03:45:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355137AbhJARr0 (ORCPT ); Fri, 1 Oct 2021 13:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbhJARrY (ORCPT ); Fri, 1 Oct 2021 13:47:24 -0400 Received: from kadath.azazel.net (kadath.azazel.net [IPv6:2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0FAFC0613E4 for ; Fri, 1 Oct 2021 10:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20190108; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/r06e2Bl3qL5kC52SgyZbcnrBLYOwAKmudZToPuh07Y=; b=lJlgBOHCm/9neH4J4izlU1jwyh 2puNRhhMXecnE6O9wCw3X1veOAB+kzH3r5EUpRRU2dTvtTVjjpiqV+lNuoM4LBcaIxX9Ef4x2G9jU DJhfmdN9cErjqJenywdCYkgW3rK876G8qzJ3yHG5pP7CUGDD+XJjNi2OKE6PqFVPgm5eYRGnZzr5z l8JgrNGZe/rKgAexK/E7d5KJySWE9espE7fFQf2kOe6b4nf1/UnwuuYpnO2Hn9xcJAM66tEinTCTK alPzh3k0GHy7QZVASFTWIZOGW+gb48spAFzXrKtLwqtxGlKxN6Fj1Cz/ei/mAPRCA4Hv8E0F4ifKY I3YPlsaA==; Received: from ulthar.dreamlands.azazel.net ([2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae]) by kadath.azazel.net with esmtp (Exim 4.94.2) (envelope-from ) id 1mWMbG-002RLP-NO; Fri, 01 Oct 2021 18:45:34 +0100 From: Jeremy Sowden To: Netfilter Devel Cc: Kyle Bowman , Alex Forster , Cloudflare Kernel Team Subject: [PATCH iptables v2 3/8] extensions: libxt_NFLOG: don't truncate log prefix on print/save Date: Fri, 1 Oct 2021 18:41:37 +0100 Message-Id: <20211001174142.1267726-4-jeremy@azazel.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001174142.1267726-1-jeremy@azazel.net> References: <20211001174142.1267726-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on kadath.azazel.net); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org From: Kyle Bowman When parsing the rule, use a struct with a layout compatible to that of struct xt_nflog_info, but with a buffer large enough to contain the whole 128-character nft prefix. We always send the nflog-group to the kernel since, for nft, log and nflog targets are handled by the same kernel module, and are distinguished by whether they define an nflog-group. Therefore, we must send the group even if it is zero, or the kernel will configure the target as a log, not an nflog. Changes to nft_is_expr_compatible were made since only targets which have an `nflog-group` are compatible. Since nflog targets are distinguished by having an nflog-group, we ignore targets without one. We also set the copy-len flag if the snap-len is set since without this, iptables will mistake `nflog-size` for `nflog-range`. Signed-off-by: Kyle Bowman Signed-off-by: Alex Forster Signed-off-by: Jeremy Sowden --- iptables/nft-shared.c | 52 +++++++++++++++++++++++++++++++++++++++++++ iptables/nft.c | 4 ++++ 2 files changed, 56 insertions(+) diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c index 4253b08196d2..2430bac44bb0 100644 --- a/iptables/nft-shared.c +++ b/iptables/nft-shared.c @@ -20,8 +20,10 @@ #include +#include #include #include +#include #include #include @@ -595,6 +597,54 @@ static void nft_parse_limit(struct nft_xt_ctx *ctx, struct nftnl_expr *e) ctx->h->ops->parse_match(match, ctx->cs); } +static void nft_parse_log(struct nft_xt_ctx *ctx, struct nftnl_expr *e) +{ + struct xtables_target *target; + struct xt_entry_target *t; + size_t target_size; + /* + * In order to handle the longer log-prefix supported by nft, instead of + * using struct xt_nflog_info, we use a struct with a compatible layout, but + * a larger buffer for the prefix. + */ + struct xt_nflog_info_nft { + __u32 len; + __u16 group; + __u16 threshold; + __u16 flags; + __u16 pad; + char prefix[NF_LOG_PREFIXLEN]; + } info = { + .group = nftnl_expr_get_u16(e, NFTNL_EXPR_LOG_GROUP), + .threshold = nftnl_expr_get_u16(e, NFTNL_EXPR_LOG_QTHRESHOLD), + }; + if (nftnl_expr_is_set(e, NFTNL_EXPR_LOG_SNAPLEN)) { + info.len = nftnl_expr_get_u32(e, NFTNL_EXPR_LOG_SNAPLEN); + info.flags = XT_NFLOG_F_COPY_LEN; + } + if (nftnl_expr_is_set(e, NFTNL_EXPR_LOG_PREFIX)) + snprintf(info.prefix, sizeof(info.prefix), "%s", + nftnl_expr_get_str(e, NFTNL_EXPR_LOG_PREFIX)); + + target = xtables_find_target("NFLOG", XTF_TRY_LOAD); + if (target == NULL) + return; + + target_size = XT_ALIGN(sizeof(struct xt_entry_target)) + + XT_ALIGN(sizeof(struct xt_nflog_info_nft)); + + t = xtables_calloc(1, target_size); + t->u.target_size = target_size; + strcpy(t->u.user.name, target->name); + t->u.user.revision = target->revision; + + target->t = t; + + memcpy(&target->t->data, &info, sizeof(info)); + + ctx->h->ops->parse_target(target, ctx->cs); +} + static void nft_parse_lookup(struct nft_xt_ctx *ctx, struct nft_handle *h, struct nftnl_expr *e) { @@ -644,6 +694,8 @@ void nft_rule_to_iptables_command_state(struct nft_handle *h, nft_parse_limit(&ctx, expr); else if (strcmp(name, "lookup") == 0) nft_parse_lookup(&ctx, h, expr); + else if (strcmp(name, "log") == 0) + nft_parse_log(&ctx, expr); expr = nftnl_expr_iter_next(iter); } diff --git a/iptables/nft.c b/iptables/nft.c index 53506c9475c0..58943088f832 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -3527,6 +3527,10 @@ static int nft_is_expr_compatible(struct nftnl_expr *expr, void *data) nftnl_expr_get_u32(expr, NFTNL_EXPR_LIMIT_FLAGS) == 0) return 0; + if (!strcmp(name, "log") && + nftnl_expr_is_set(expr, NFTNL_EXPR_LOG_GROUP)) + return 0; + return -1; } From patchwork Fri Oct 1 17:41:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1535460 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=azazel.net header.i=@azazel.net header.a=rsa-sha256 header.s=20190108 header.b=czi5CJtI; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HLcwC39ybz9t0k for ; Sat, 2 Oct 2021 03:45:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355299AbhJARr0 (ORCPT ); Fri, 1 Oct 2021 13:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355137AbhJARrY (ORCPT ); Fri, 1 Oct 2021 13:47:24 -0400 Received: from kadath.azazel.net (kadath.azazel.net [IPv6:2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E5F6C0613E2 for ; Fri, 1 Oct 2021 10:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20190108; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=cp+dsN8bxedox04sctX+JaBULyXR+ytH1tFE6L981ZA=; b=czi5CJtIaI+lfO+o/lcNqNQsyb 7D20aIOTepePMywMdZ2q0q83e8g//v2A9GcA9MXuopOQLhywldKQ2Ufmq36hzBHmFBw84eJ3iSBiT db1JdcXdJ1YunYpSr22TZphWarR1dUNy/fWYiAZ9S2dNRx1V7Cv4hyqg/y7MJK4r/fCd576iCdc2j 3gKPkNLy97v6aTa27Y3KZGNt14rBBMt+XQqvUuzAk72qKnoz5GeqW3HFydDOIf0MGGBXOJnPb4Q+g fGPdFPks/jcqQ5IK+TfObjD+49G6Uz/WhzfPKAvn4hvfyxKWm+1b0WChO4ZtOtXV32j0Yxam9FHkb Uciqna5Q==; Received: from ulthar.dreamlands.azazel.net ([2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae]) by kadath.azazel.net with esmtp (Exim 4.94.2) (envelope-from ) id 1mWMbG-002RLP-TZ; Fri, 01 Oct 2021 18:45:34 +0100 From: Jeremy Sowden To: Netfilter Devel Cc: Kyle Bowman , Alex Forster , Cloudflare Kernel Team Subject: [PATCH iptables v2 4/8] extensions: libxt_NFLOG: disable `--nflog-range` Python test-cases Date: Fri, 1 Oct 2021 18:41:38 +0100 Message-Id: <20211001174142.1267726-5-jeremy@azazel.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001174142.1267726-1-jeremy@azazel.net> References: <20211001174142.1267726-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on kadath.azazel.net); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org From: Kyle Bowman nft has no equivalent to `--nflog-range`, so we cannot emulate it and the Python unit-tests for it fail. However, since `--nflog-range` is broken and doesn't do anything, the tests are not testing anything useful. Signed-off-by: Kyle Bowman Signed-off-by: Alex Forster Signed-off-by: Jeremy Sowden --- extensions/libxt_NFLOG.t | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extensions/libxt_NFLOG.t b/extensions/libxt_NFLOG.t index 933fa22160e5..eefb058be30e 100644 --- a/extensions/libxt_NFLOG.t +++ b/extensions/libxt_NFLOG.t @@ -3,10 +3,12 @@ -j NFLOG --nflog-group 65535;=;OK -j NFLOG --nflog-group 65536;;FAIL -j NFLOG --nflog-group 0;-j NFLOG;OK --j NFLOG --nflog-range 1;=;OK --j NFLOG --nflog-range 4294967295;=;OK --j NFLOG --nflog-range 4294967296;;FAIL --j NFLOG --nflog-range -1;;FAIL +# `--nflog-range` is broken and only supported by xtables-legacy. It +# has been superseded by `--nflog--group`. +# -j NFLOG --nflog-range 1;=;OK +# -j NFLOG --nflog-range 4294967295;=;OK +# -j NFLOG --nflog-range 4294967296;;FAIL +# -j NFLOG --nflog-range -1;;FAIL -j NFLOG --nflog-size 0;=;OK -j NFLOG --nflog-size 1;=;OK -j NFLOG --nflog-size 4294967295;=;OK From patchwork Fri Oct 1 17:41:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1535459 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=azazel.net header.i=@azazel.net header.a=rsa-sha256 header.s=20190108 header.b=UkkMxWpG; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HLcwC0bNnz9t1C for ; Sat, 2 Oct 2021 03:45:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355287AbhJARrZ (ORCPT ); Fri, 1 Oct 2021 13:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355161AbhJARrY (ORCPT ); Fri, 1 Oct 2021 13:47:24 -0400 Received: from kadath.azazel.net (kadath.azazel.net [IPv6:2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94483C0613E3 for ; Fri, 1 Oct 2021 10:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20190108; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=lQPAy9dL+C7E5ele8IjmeZ3sVL1dn+jn6e1mc9tWNc8=; b=UkkMxWpGCMLtpxPdO0ldE3nNFb 076VvVdHEjjmaeuq3brCLygFFLosRqftgJeEM8zWADVxVQqVbukrx2E3xeA7SZ8gh+2FKceQPLEtt f15gs3DZCqW6OkhNPAtvfX6MM3JzrW0SwYE66ZcmjaPoIKfAWeZgPvSguhsbdevZBvBeff2Q6Q8Qr JrHFtL32kKTDKPPgDXyKPz5x1AIRWGYMpmpBxXvz6RoA+jMA/CTDluuiK3xzW5r4c9ufDuoVm5b5K rWeiqGI0JPQoe6SU04MbAQpxc8BZ1YCIvcqW5oG7LnmWQdT3SwKV6vJEcHQuSx1pE/TUdZZdz/H5e UcJO4nqA==; Received: from ulthar.dreamlands.azazel.net ([2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae]) by kadath.azazel.net with esmtp (Exim 4.94.2) (envelope-from ) id 1mWMbH-002RLP-2w; Fri, 01 Oct 2021 18:45:35 +0100 From: Jeremy Sowden To: Netfilter Devel Cc: Kyle Bowman , Alex Forster , Cloudflare Kernel Team Subject: [PATCH iptables v2 5/8] extensions: libxt_NFLOG: fix `--nflog-prefix` Python test-cases Date: Fri, 1 Oct 2021 18:41:39 +0100 Message-Id: <20211001174142.1267726-6-jeremy@azazel.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001174142.1267726-1-jeremy@azazel.net> References: <20211001174142.1267726-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on kadath.azazel.net); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org The `iptables-save` includes an extra space between `--nflog-prefix` and the prefix. The maximum length of prefixes includes the trailing NUL character. NFLOG silently truncates prefixes which exceed the maximum length. Signed-off-by: Jeremy Sowden --- extensions/libxt_NFLOG.t | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/libxt_NFLOG.t b/extensions/libxt_NFLOG.t index eefb058be30e..13bbf2bfc5a5 100644 --- a/extensions/libxt_NFLOG.t +++ b/extensions/libxt_NFLOG.t @@ -14,10 +14,8 @@ -j NFLOG --nflog-size 4294967295;=;OK -j NFLOG --nflog-size 4294967296;;FAIL -j NFLOG --nflog-size -1;;FAIL -# ERROR: cannot find: iptables -I INPUT -j NFLOG --nflog-prefix xxxxxx [...] -# -j NFLOG --nflog-prefix xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;=;OK -# ERROR: should fail: iptables -A INPUT -j NFLOG --nflog-prefix xxxxxxx [...] -# -j NFLOG --nflog-prefix xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;;FAIL +-j NFLOG --nflog-prefix xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;=;OK +-j NFLOG --nflog-prefix xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;-j NFLOG --nflog-prefix xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;OK -j NFLOG --nflog-threshold 1;=;OK # ERROR: line 13 (should fail: iptables -A INPUT -j NFLOG --nflog-threshold 0 # -j NFLOG --nflog-threshold 0;;FAIL From patchwork Fri Oct 1 17:41:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1535457 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=azazel.net header.i=@azazel.net header.a=rsa-sha256 header.s=20190108 header.b=BXRRXT+R; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HLcwB364bz9t1Q for ; Sat, 2 Oct 2021 03:45:46 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355277AbhJARrZ (ORCPT ); Fri, 1 Oct 2021 13:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355106AbhJARrY (ORCPT ); Fri, 1 Oct 2021 13:47:24 -0400 Received: from kadath.azazel.net (kadath.azazel.net [IPv6:2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E51DC06177F for ; Fri, 1 Oct 2021 10:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20190108; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+h56Sy0+UdoWEiItUs4F4I3Zcaqfu9wn35hlVLRMAOg=; b=BXRRXT+ROn4ewEte77K6vEgkaT BKlCINUz3A6oTQ7FuMPWnay1iO0MgfFnKcx6B+c1m5aVqXpSbKYaBc+r/LdKCWyW9KDXSjgymU/KK PAITkpa0NlWeWRN8P9iNjHbwZNxJE8SXZIIbl1YemQLWFI0sqwn67ufpcx7dSzC/DEvdsxcUlP/Q/ xGXO+d3xrzqhO55jECHZMulIcy0SHoSXN3JRL46XszeCqxe3JWuX/DgiphTUwFzwUibHvl2bBiuGy sbLSV9uUvvgQw0xtwz5HV9MH+O5Hy/0pBuQfyAqtjUDE/KkkAabSAYs7w9aF8wHu27e4VthxE+GHc mh14ZqUA==; Received: from ulthar.dreamlands.azazel.net ([2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae]) by kadath.azazel.net with esmtp (Exim 4.94.2) (envelope-from ) id 1mWMbH-002RLP-8K; Fri, 01 Oct 2021 18:45:35 +0100 From: Jeremy Sowden To: Netfilter Devel Cc: Kyle Bowman , Alex Forster , Cloudflare Kernel Team Subject: [PATCH iptables v2 6/8] extensions: libxt_NFLOG: remove extra space when saving targets with prefixes Date: Fri, 1 Oct 2021 18:41:40 +0100 Message-Id: <20211001174142.1267726-7-jeremy@azazel.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001174142.1267726-1-jeremy@azazel.net> References: <20211001174142.1267726-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on kadath.azazel.net); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org When printing out NFLOG targets an extra space was inserted between `--nflog-prefix` and the prefix itself: $ sudo /usr/sbin/iptables -A INPUT -j NFLOG --nflog-prefix test $ sudo /usr/sbin/iptables-save | grep NFLOG -A INPUT -j NFLOG --nflog-prefix test ^^ Fixes: 73866357e4a7 ("iptables: do not print trailing whitespaces") Signed-off-by: Jeremy Sowden --- extensions/libxt_NFLOG.c | 2 +- extensions/libxt_NFLOG.t | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/libxt_NFLOG.c b/extensions/libxt_NFLOG.c index 2b78e27808f8..6137a68f8cd2 100644 --- a/extensions/libxt_NFLOG.c +++ b/extensions/libxt_NFLOG.c @@ -83,7 +83,7 @@ static void NFLOG_check(struct xt_fcheck_call *cb) static void nflog_print(const struct xt_nflog_info *info, char *prefix) { if (info->prefix[0] != '\0') { - printf(" %snflog-prefix ", prefix); + printf(" %snflog-prefix", prefix); xtables_save_string(info->prefix); } if (info->group) diff --git a/extensions/libxt_NFLOG.t b/extensions/libxt_NFLOG.t index 13bbf2bfc5a5..561ec8c77650 100644 --- a/extensions/libxt_NFLOG.t +++ b/extensions/libxt_NFLOG.t @@ -14,8 +14,8 @@ -j NFLOG --nflog-size 4294967295;=;OK -j NFLOG --nflog-size 4294967296;;FAIL -j NFLOG --nflog-size -1;;FAIL --j NFLOG --nflog-prefix xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;=;OK --j NFLOG --nflog-prefix xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;-j NFLOG --nflog-prefix xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;OK +-j NFLOG --nflog-prefix xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;=;OK +-j NFLOG --nflog-prefix xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;-j NFLOG --nflog-prefix xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;OK -j NFLOG --nflog-threshold 1;=;OK # ERROR: line 13 (should fail: iptables -A INPUT -j NFLOG --nflog-threshold 0 # -j NFLOG --nflog-threshold 0;;FAIL From patchwork Fri Oct 1 17:41:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1535455 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HLcw45qbwz9t0k for ; Sat, 2 Oct 2021 03:45:40 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232106AbhJARrY (ORCPT ); Fri, 1 Oct 2021 13:47:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbhJARrX (ORCPT ); Fri, 1 Oct 2021 13:47:23 -0400 Received: from kadath.azazel.net (kadath.azazel.net [IPv6:2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AD15C061775 for ; Fri, 1 Oct 2021 10:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20190108; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+xxHYrElmh87SRZkPTXXk1VW0QMjjj+6mCW9qHprG5E=; b=NqQ77BpVaqhure5983r/Mx/uJx h9qDCn7Hu0dMwXBYZV8fjVUrPQYfBAQmfWEJX6Mt+p1do8HAZAebUSLARwq4FqzLFbW1JQ4lEuQtt BuxwU+d9HE/HoYWy4NnBwNAO8x4gwnQZvxx9AbTwnGlkAMCh939pyz0H61NAxoTYuWOApeoMlgzv3 uMw04JfHdze9dVemywrJfTMokQtYWLJlATIsAsU+4vHvHPCE4kySaaCPwnZ6Y3KO6ZbobWXJXuQ9G B9+K6P8NvCeSgrL9UU05HHbnn0hO4eESht2ZwqTLZtdchRf0e58Ee8Fz9OOne7mA8TghJwEoUL4uj LNddPfMA==; Received: from ulthar.dreamlands.azazel.net ([2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae]) by kadath.azazel.net with esmtp (Exim 4.94.2) (envelope-from ) id 1mWMbH-002RLP-Gd; Fri, 01 Oct 2021 18:45:35 +0100 From: Jeremy Sowden To: Netfilter Devel Cc: Kyle Bowman , Alex Forster , Cloudflare Kernel Team Subject: [PATCH iptables v2 7/8] build: replace `AM_PROG_LIBTOOL` and `AC_DISABLE_STATIC` with `LT_INIT` Date: Fri, 1 Oct 2021 18:41:41 +0100 Message-Id: <20211001174142.1267726-8-jeremy@azazel.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001174142.1267726-1-jeremy@azazel.net> References: <20211001174142.1267726-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on kadath.azazel.net); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org `AM_PROG_LIBTOOL` is superseded by `LT_INIT`, which also accepts options to control the defaults for creating shared or static libraries. Signed-off-by: Jeremy Sowden --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 00ae60c5cfa1..86c67194825f 100644 --- a/configure.ac +++ b/configure.ac @@ -12,9 +12,8 @@ AC_PROG_INSTALL AM_INIT_AUTOMAKE([-Wall]) AC_PROG_CC AM_PROG_CC_C_O -AC_DISABLE_STATIC m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) -AM_PROG_LIBTOOL +LT_INIT([disable-static]) AC_ARG_WITH([kernel], AS_HELP_STRING([--with-kernel=PATH], From patchwork Fri Oct 1 17:41:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1535463 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=azazel.net header.i=@azazel.net header.a=rsa-sha256 header.s=20190108 header.b=OJfb2upt; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HLcwD3M5tz9t1C for ; Sat, 2 Oct 2021 03:45:48 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355303AbhJARr2 (ORCPT ); Fri, 1 Oct 2021 13:47:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355237AbhJARrY (ORCPT ); Fri, 1 Oct 2021 13:47:24 -0400 Received: from kadath.azazel.net (kadath.azazel.net [IPv6:2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26965C06177D for ; Fri, 1 Oct 2021 10:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20190108; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6ZVOaoXA8b9aYOU8Z8j76Fogaads+UzuYHWVnO+9icU=; b=OJfb2uptCE46jWmZlUMRWz+Jcx rJiUrDV3SspeHlLsHtIkIBYDbXAwZYy+MSTTlapEuXUfKgmvtzvLRFkfF6sQTChFKDYb5vCN4mqv7 WOrJsLv3XhzZx0JOy6Xk/42UmlnUwcl+RZvLAiptDLk0TXXgJuCrShKQZaFoxarwLRIFIdJatrmJf SD9Cr8cc3oszD7z0bMSR3GENqAMc7fsAPUEyDP1TvEAz89M0Snd0AY2GhvnhhWEfJ6jzEb3LtajJr m996aocvaE9ouuZX4T0KtEvGVBLsp0zkITk32+9FLnMqacY4i/UamKSFzpa9MM2Gqb+a6HSa25IFF R4C2Fq9g==; Received: from ulthar.dreamlands.azazel.net ([2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae]) by kadath.azazel.net with esmtp (Exim 4.94.2) (envelope-from ) id 1mWMbH-002RLP-Nn; Fri, 01 Oct 2021 18:45:35 +0100 From: Jeremy Sowden To: Netfilter Devel Cc: Kyle Bowman , Alex Forster , Cloudflare Kernel Team Subject: [PATCH iptables v2 8/8] tests: iptables-test: correct misspelt variable Date: Fri, 1 Oct 2021 18:41:42 +0100 Message-Id: <20211001174142.1267726-9-jeremy@azazel.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001174142.1267726-1-jeremy@azazel.net> References: <20211001174142.1267726-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:fb7d:d6d7:2e4d:54ff:fe4b:a9ae X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on kadath.azazel.net); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org "EXECUTEABLE" -> "EXECUTABLE" Signed-off-by: Jeremy Sowden --- iptables-test.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/iptables-test.py b/iptables-test.py index 0ba3d36864fd..95fa11b1475c 100755 --- a/iptables-test.py +++ b/iptables-test.py @@ -84,7 +84,7 @@ def run_test(iptables, rule, rule_save, res, filename, lineno, netns): cmd = iptables + " -A " + rule if netns: - cmd = "ip netns exec ____iptables-container-test " + EXECUTEABLE + " " + cmd + cmd = "ip netns exec ____iptables-container-test " + EXECUTABLE + " " + cmd ret = execute_cmd(cmd, filename, lineno) @@ -123,7 +123,7 @@ def run_test(iptables, rule, rule_save, res, filename, lineno, netns): elif splitted[0] == EBTABLES: command = EBTABLES_SAVE - command = EXECUTEABLE + " " + command + command = EXECUTABLE + " " + command if netns: command = "ip netns exec ____iptables-container-test " + command @@ -168,7 +168,7 @@ def execute_cmd(cmd, filename, lineno): ''' global log_file if cmd.startswith('iptables ') or cmd.startswith('ip6tables ') or cmd.startswith('ebtables ') or cmd.startswith('arptables '): - cmd = EXECUTEABLE + " " + cmd + cmd = EXECUTABLE + " " + cmd print("command: {}".format(cmd), file=log_file) ret = subprocess.call(cmd, shell=True, universal_newlines=True, @@ -202,12 +202,12 @@ def run_test_file(filename, netns): iptables = IPTABLES elif "libarpt_" in filename: # only supported with nf_tables backend - if EXECUTEABLE != "xtables-nft-multi": + if EXECUTABLE != "xtables-nft-multi": return 0, 0 iptables = ARPTABLES elif "libebt_" in filename: # only supported with nf_tables backend - if EXECUTEABLE != "xtables-nft-multi": + if EXECUTABLE != "xtables-nft-multi": return 0, 0 iptables = EBTABLES else: @@ -245,7 +245,7 @@ def run_test_file(filename, netns): if line[0] == "%": external_cmd = line.rstrip()[1:] if netns: - external_cmd = "ip netns exec ____iptables-container-test " + EXECUTEABLE + " " + external_cmd + external_cmd = "ip netns exec ____iptables-container-test " + EXECUTABLE + " " + external_cmd execute_cmd(external_cmd, filename, lineno) continue @@ -366,10 +366,10 @@ def main(): show_missing() return - global EXECUTEABLE - EXECUTEABLE = "xtables-legacy-multi" + global EXECUTABLE + EXECUTABLE = "xtables-legacy-multi" if args.nftables: - EXECUTEABLE = "xtables-nft-multi" + EXECUTABLE = "xtables-nft-multi" if os.getuid() != 0: print("You need to be root to run this, sorry", file=sys.stderr)