Netdev List
 help / color / mirror / Atom feed
* [PATCH net v2] selftests: netfilter: conntrack_dump_flush: remove unused variables and fix typo
@ 2026-08-07  7:59 Qingshuang Fu
  2026-08-07  9:07 ` Hangbin Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Qingshuang Fu @ 2026-08-07  7:59 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Florian Westphal, davem, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
  Cc: netfilter-devel, coreteam, netdev, linux-kselftest, linux-kernel,
	Qingshuang Fu, Qingshuang Fu, Fernando Fernandez Mancera

From: Qingshuang Fu <fuqingshuang@kylinos.cn>

Remove unused 'rplnlh' in conntrack_data_insert(), and remove unused
'rplnlh' and 'nest' variables in conntrack_count_zone() and
conntrack_flush_zone(). These variables were declared but never used
since their introduction.

Also fix typo: rename misspelled conntracK_count_zone() to
conntrack_count_zone().

Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Qingshuang Fu <fuqingshuang@kylinos.cn>
---
v2:
  - Drop Fixes tag as this is a cleanup, not a bug fix
  - Add Reviewed-by tag from Fernando Fernandez Mancera
  - Also fix the typo in function name conntracK_count_zone
  - Link to v1: https://lore.kernel.org/all/20260806075052.1934904-1-fffsqian@163.com/
---
 .../net/netfilter/conntrack_dump_flush.c      | 31 +++++++++----------
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/tools/testing/selftests/net/netfilter/conntrack_dump_flush.c b/tools/testing/selftests/net/netfilter/conntrack_dump_flush.c
index 5cecb8a1bc94..31b8250ddc53 100644
--- a/tools/testing/selftests/net/netfilter/conntrack_dump_flush.c
+++ b/tools/testing/selftests/net/netfilter/conntrack_dump_flush.c
@@ -102,7 +102,6 @@ static int conntrack_data_insert(struct mnl_socket *sock, struct nlmsghdr *nlh,
 				 uint16_t zone)
 {
 	char buf[MNL_SOCKET_BUFFER_SIZE];
-	struct nlmsghdr *rplnlh;
 	unsigned int portid;
 	int ret;
 
@@ -216,12 +215,11 @@ static int count_entries(const struct nlmsghdr *nlh, void *data)
 	return MNL_CB_OK;
 }
 
-static int conntracK_count_zone(struct mnl_socket *sock, uint16_t zone)
+static int conntrack_count_zone(struct mnl_socket *sock, uint16_t zone)
 {
 	char buf[MNL_SOCKET_BUFFER_SIZE];
-	struct nlmsghdr *nlh, *rplnlh;
+	struct nlmsghdr *nlh;
 	struct nfgenmsg *nfh;
-	struct nlattr *nest;
 	unsigned int portid;
 	int ret;
 
@@ -266,9 +264,8 @@ static int conntracK_count_zone(struct mnl_socket *sock, uint16_t zone)
 static int conntrack_flush_zone(struct mnl_socket *sock, uint16_t zone)
 {
 	char buf[MNL_SOCKET_BUFFER_SIZE];
-	struct nlmsghdr *nlh, *rplnlh;
+	struct nlmsghdr *nlh;
 	struct nfgenmsg *nfh;
-	struct nlattr *nest;
 	unsigned int portid;
 	int ret;
 
@@ -326,7 +323,7 @@ FIXTURE_SETUP(conntrack_dump_flush)
 	ret = mnl_socket_bind(self->sock, 0, MNL_SOCKET_AUTOPID);
 	EXPECT_EQ(ret, 0);
 
-	ret = conntracK_count_zone(self->sock, TEST_ZONE_ID);
+	ret = conntrack_count_zone(self->sock, TEST_ZONE_ID);
 	if (ret < 0 && errno == EPERM)
 		SKIP(return, "Needs to be run as root");
 	else if (ret < 0 && errno == EOPNOTSUPP)
@@ -423,7 +420,7 @@ FIXTURE_SETUP(conntrack_dump_flush)
 					 NF_CT_DEFAULT_ZONE_ID);
 	EXPECT_EQ(ret, 0);
 
-	ret = conntracK_count_zone(self->sock, TEST_ZONE_ID);
+	ret = conntrack_count_zone(self->sock, TEST_ZONE_ID);
 	EXPECT_GE(ret, 2);
 	if (ret > 2)
 		SKIP(return, "kernel does not support filtering by zone");
@@ -437,7 +434,7 @@ TEST_F(conntrack_dump_flush, test_dump_by_zone)
 {
 	int ret;
 
-	ret = conntracK_count_zone(self->sock, TEST_ZONE_ID);
+	ret = conntrack_count_zone(self->sock, TEST_ZONE_ID);
 	EXPECT_EQ(ret, 2);
 }
 
@@ -447,13 +444,13 @@ TEST_F(conntrack_dump_flush, test_flush_by_zone)
 
 	ret = conntrack_flush_zone(self->sock, TEST_ZONE_ID);
 	EXPECT_EQ(ret, 0);
-	ret = conntracK_count_zone(self->sock, TEST_ZONE_ID);
+	ret = conntrack_count_zone(self->sock, TEST_ZONE_ID);
 	EXPECT_EQ(ret, 0);
-	ret = conntracK_count_zone(self->sock, TEST_ZONE_ID + 1);
+	ret = conntrack_count_zone(self->sock, TEST_ZONE_ID + 1);
 	EXPECT_EQ(ret, 2);
-	ret = conntracK_count_zone(self->sock, TEST_ZONE_ID + 2);
+	ret = conntrack_count_zone(self->sock, TEST_ZONE_ID + 2);
 	EXPECT_EQ(ret, 2);
-	ret = conntracK_count_zone(self->sock, NF_CT_DEFAULT_ZONE_ID);
+	ret = conntrack_count_zone(self->sock, NF_CT_DEFAULT_ZONE_ID);
 	EXPECT_EQ(ret, 2);
 }
 
@@ -463,13 +460,13 @@ TEST_F(conntrack_dump_flush, test_flush_by_zone_default)
 
 	ret = conntrack_flush_zone(self->sock, NF_CT_DEFAULT_ZONE_ID);
 	EXPECT_EQ(ret, 0);
-	ret = conntracK_count_zone(self->sock, TEST_ZONE_ID);
+	ret = conntrack_count_zone(self->sock, TEST_ZONE_ID);
 	EXPECT_EQ(ret, 2);
-	ret = conntracK_count_zone(self->sock, TEST_ZONE_ID + 1);
+	ret = conntrack_count_zone(self->sock, TEST_ZONE_ID + 1);
 	EXPECT_EQ(ret, 2);
-	ret = conntracK_count_zone(self->sock, TEST_ZONE_ID + 2);
+	ret = conntrack_count_zone(self->sock, TEST_ZONE_ID + 2);
 	EXPECT_EQ(ret, 2);
-	ret = conntracK_count_zone(self->sock, NF_CT_DEFAULT_ZONE_ID);
+	ret = conntrack_count_zone(self->sock, NF_CT_DEFAULT_ZONE_ID);
 	EXPECT_EQ(ret, 0);
 }
 

base-commit: 0d839570765118029aa8bf4a95444c6a11aacf85
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] selftests: netfilter: conntrack_dump_flush: remove unused variables and fix typo
  2026-08-07  7:59 [PATCH net v2] selftests: netfilter: conntrack_dump_flush: remove unused variables and fix typo Qingshuang Fu
@ 2026-08-07  9:07 ` Hangbin Liu
  2026-08-07 10:23   ` Pablo Neira Ayuso
  0 siblings, 1 reply; 4+ messages in thread
From: Hangbin Liu @ 2026-08-07  9:07 UTC (permalink / raw)
  To: Qingshuang Fu
  Cc: Pablo Neira Ayuso, Florian Westphal, davem, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
	netfilter-devel, coreteam, netdev, linux-kselftest, linux-kernel,
	Qingshuang Fu, Fernando Fernandez Mancera

On Fri, Aug 07, 2026 at 03:59:28PM +0800, Qingshuang Fu wrote:
> From: Qingshuang Fu <fuqingshuang@kylinos.cn>
> 
> Remove unused 'rplnlh' in conntrack_data_insert(), and remove unused
> 'rplnlh' and 'nest' variables in conntrack_count_zone() and
> conntrack_flush_zone(). These variables were declared but never used
> since their introduction.
> 
> Also fix typo: rename misspelled conntracK_count_zone() to
> conntrack_count_zone().
> 
> Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
> Signed-off-by: Qingshuang Fu <fuqingshuang@kylinos.cn>

> ---
> v2:
>   - Drop Fixes tag as this is a cleanup, not a bug fix

If not a bug fix, you should target to net-next.

Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] selftests: netfilter: conntrack_dump_flush: remove unused variables and fix typo
  2026-08-07  9:07 ` Hangbin Liu
@ 2026-08-07 10:23   ` Pablo Neira Ayuso
  2026-08-08  6:26     ` Hangbin Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Pablo Neira Ayuso @ 2026-08-07 10:23 UTC (permalink / raw)
  To: Hangbin Liu
  Cc: Qingshuang Fu, Florian Westphal, davem, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
	netfilter-devel, coreteam, netdev, linux-kselftest, linux-kernel,
	Qingshuang Fu, Fernando Fernandez Mancera

On Fri, Aug 07, 2026 at 05:07:13PM +0800, Hangbin Liu wrote:
> On Fri, Aug 07, 2026 at 03:59:28PM +0800, Qingshuang Fu wrote:
> > From: Qingshuang Fu <fuqingshuang@kylinos.cn>
> > 
> > Remove unused 'rplnlh' in conntrack_data_insert(), and remove unused
> > 'rplnlh' and 'nest' variables in conntrack_count_zone() and
> > conntrack_flush_zone(). These variables were declared but never used
> > since their introduction.
> > 
> > Also fix typo: rename misspelled conntracK_count_zone() to
> > conntrack_count_zone().
> > 
> > Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
> > Signed-off-by: Qingshuang Fu <fuqingshuang@kylinos.cn>
> 
> > ---
> > v2:
> >   - Drop Fixes tag as this is a cleanup, not a bug fix
> 
> If not a bug fix, you should target to net-next.

We will handle this though the nf-next tree.

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] selftests: netfilter: conntrack_dump_flush: remove unused variables and fix typo
  2026-08-07 10:23   ` Pablo Neira Ayuso
@ 2026-08-08  6:26     ` Hangbin Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Hangbin Liu @ 2026-08-08  6:26 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Qingshuang Fu, Florian Westphal, netfilter-devel, coreteam,
	netdev, linux-kselftest, linux-kernel, Qingshuang Fu,
	Fernando Fernandez Mancera

On Fri, Aug 07, 2026 at 12:23:45PM +0200, Pablo Neira Ayuso wrote:
> On Fri, Aug 07, 2026 at 05:07:13PM +0800, Hangbin Liu wrote:
> > On Fri, Aug 07, 2026 at 03:59:28PM +0800, Qingshuang Fu wrote:
> > > From: Qingshuang Fu <fuqingshuang@kylinos.cn>
> > > 
> > > Remove unused 'rplnlh' in conntrack_data_insert(), and remove unused
> > > 'rplnlh' and 'nest' variables in conntrack_count_zone() and
> > > conntrack_flush_zone(). These variables were declared but never used
> > > since their introduction.
> > > 
> > > Also fix typo: rename misspelled conntracK_count_zone() to
> > > conntrack_count_zone().
> > > 
> > > Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
> > > Signed-off-by: Qingshuang Fu <fuqingshuang@kylinos.cn>
> > 
> > > ---
> > > v2:
> > >   - Drop Fixes tag as this is a cleanup, not a bug fix
> > 
> > If not a bug fix, you should target to net-next.
> 
> We will handle this though the nf-next tree.

Oh, good. That's more reasonable.

Hangbin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-08  6:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07  7:59 [PATCH net v2] selftests: netfilter: conntrack_dump_flush: remove unused variables and fix typo Qingshuang Fu
2026-08-07  9:07 ` Hangbin Liu
2026-08-07 10:23   ` Pablo Neira Ayuso
2026-08-08  6:26     ` Hangbin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox