netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: fw@strlen.de, fmyhr@fhmtech.com, stefanh@hafenthal.de
Subject: [PATCH nf-next 1/2] netfilter: nftables: rename NFT_CT_HELPER to NFT_CT_HELPER_TYPE
Date: Tue,  9 Mar 2021 22:01:33 +0100	[thread overview]
Message-ID: <20210309210134.13620-2-pablo@netfilter.org> (raw)
In-Reply-To: <20210309210134.13620-1-pablo@netfilter.org>

The existing NFT_CT_HELPER allows to match on the helper type, rename
this attribute to support for matching on the helper object name.

NFT_CT_HELPER is left in place for backward compatibility.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 include/uapi/linux/netfilter/nf_tables.h | 5 +++--
 net/netfilter/nft_ct.c                   | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
index 79bab7a36b30..481e32c1b1b2 100644
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
@@ -1047,7 +1047,7 @@ enum nft_socket_keys {
  * @NFT_CT_MARK: conntrack mark value
  * @NFT_CT_SECMARK: conntrack secmark value
  * @NFT_CT_EXPIRATION: relative conntrack expiration time in ms
- * @NFT_CT_HELPER: connection tracking helper assigned to conntrack
+ * @NFT_CT_HELPER_TYPE: connection tracking helper type assigned to conntrack
  * @NFT_CT_L3PROTOCOL: conntrack layer 3 protocol
  * @NFT_CT_SRC: conntrack layer 3 protocol source (IPv4/IPv6 address, deprecated)
  * @NFT_CT_DST: conntrack layer 3 protocol destination (IPv4/IPv6 address, deprecated)
@@ -1073,7 +1073,8 @@ enum nft_ct_keys {
 	NFT_CT_MARK,
 	NFT_CT_SECMARK,
 	NFT_CT_EXPIRATION,
-	NFT_CT_HELPER,
+	NFT_CT_HELPER_TYPE,
+#define NFT_CT_HELPER	NFT_CT_HELPER_TYPE
 	NFT_CT_L3PROTOCOL,
 	NFT_CT_SRC,
 	NFT_CT_DST,
diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index 882fe8648653..a9041dce9345 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -107,7 +107,7 @@ static void nft_ct_get_eval(const struct nft_expr *expr,
 	case NFT_CT_EXPIRATION:
 		*dest = jiffies_to_msecs(nf_ct_expires(ct));
 		return;
-	case NFT_CT_HELPER:
+	case NFT_CT_HELPER_TYPE:
 		if (ct->master == NULL)
 			goto err;
 		help = nfct_help(ct->master);
@@ -418,7 +418,7 @@ static int nft_ct_get_init(const struct nft_ctx *ctx,
 		len = NF_CT_LABELS_MAX_SIZE;
 		break;
 #endif
-	case NFT_CT_HELPER:
+	case NFT_CT_HELPER_TYPE:
 		if (tb[NFTA_CT_DIRECTION] != NULL)
 			return -EINVAL;
 		len = NF_CT_HELPER_NAME_LEN;
-- 
2.20.1


  reply	other threads:[~2021-03-09 21:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 21:01 [PATCH RFC nf-next 0/2] ct helper object name matching Pablo Neira Ayuso
2021-03-09 21:01 ` Pablo Neira Ayuso [this message]
2021-03-09 21:01 ` [PATCH nf-next 2/2] netfilter: nftables: add NFT_CT_HELPER_OBJNAME Pablo Neira Ayuso
2021-03-09 21:18 ` [PATCH RFC nf-next 0/2] ct helper object name matching Florian Westphal
2021-03-09 21:24   ` Pablo Neira Ayuso

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=20210309210134.13620-2-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=fmyhr@fhmtech.com \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=stefanh@hafenthal.de \
    /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).