netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ipset PATCH 0/2] Two minor code fixes
@ 2023-02-22 17:02 Phil Sutter
  2023-02-22 17:02 ` [ipset PATCH 1/2] xlate: Fix for fd leak in error path Phil Sutter
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Phil Sutter @ 2023-02-22 17:02 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter-devel

These were identified by Coverity tool, no problems in practice. Still
worth fixing to reduce noise in code checkers.

Phil Sutter (2):
  xlate: Fix for fd leak in error path
  xlate: Drop dead code

 lib/ipset.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

-- 
2.38.0


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

* [ipset PATCH 1/2] xlate: Fix for fd leak in error path
  2023-02-22 17:02 [ipset PATCH 0/2] Two minor code fixes Phil Sutter
@ 2023-02-22 17:02 ` Phil Sutter
  2023-02-22 17:02 ` [ipset PATCH 2/2] xlate: Drop dead code Phil Sutter
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Phil Sutter @ 2023-02-22 17:02 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter-devel

A rather cosmetic issue though, the program will terminate anyway.

Fixes: 325af556cd3a6 ("add ipset to nftables translation infrastructure")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 lib/ipset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ipset.c b/lib/ipset.c
index f57b07413cba5..2e098e435d954 100644
--- a/lib/ipset.c
+++ b/lib/ipset.c
@@ -1999,7 +1999,7 @@ static int ipset_xlate_restore(struct ipset *ipset)
 
 		ret = build_argv(ipset, c);
 		if (ret < 0)
-			return ret;
+			break;
 
 		cmd = ipset_parser(ipset, ipset->newargc, ipset->newargv);
 		if (cmd < 0)
-- 
2.38.0


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

* [ipset PATCH 2/2] xlate: Drop dead code
  2023-02-22 17:02 [ipset PATCH 0/2] Two minor code fixes Phil Sutter
  2023-02-22 17:02 ` [ipset PATCH 1/2] xlate: Fix for fd leak in error path Phil Sutter
@ 2023-02-22 17:02 ` Phil Sutter
  2023-03-01 22:28 ` [ipset PATCH 0/2] Two minor code fixes Pablo Neira Ayuso
  2023-03-10 12:18 ` Phil Sutter
  3 siblings, 0 replies; 11+ messages in thread
From: Phil Sutter @ 2023-02-22 17:02 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter-devel

Set type is not needed when manipulating elements, the assigned
variable was unused in that case.

Fixes: 325af556cd3a6 ("add ipset to nftables translation infrastructure")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 lib/ipset.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/ipset.c b/lib/ipset.c
index 2e098e435d954..8e63af56d2a51 100644
--- a/lib/ipset.c
+++ b/lib/ipset.c
@@ -1876,9 +1876,6 @@ static int ipset_xlate(struct ipset *ipset, enum ipset_cmd cmd,
 				cmd == IPSET_CMD_DEL ? "delete" : "get",
 		       ipset_xlate_family(family), table, set);
 
-		typename = ipset_data_get(data, IPSET_OPT_TYPENAME);
-		type = ipset_xlate_set_type(typename);
-
 		xlate_set = (struct ipset_xlate_set *)
 				ipset_xlate_set_get(ipset, set);
 		if (xlate_set && xlate_set->interval)
-- 
2.38.0


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

* Re: [ipset PATCH 0/2] Two minor code fixes
  2023-02-22 17:02 [ipset PATCH 0/2] Two minor code fixes Phil Sutter
  2023-02-22 17:02 ` [ipset PATCH 1/2] xlate: Fix for fd leak in error path Phil Sutter
  2023-02-22 17:02 ` [ipset PATCH 2/2] xlate: Drop dead code Phil Sutter
@ 2023-03-01 22:28 ` Pablo Neira Ayuso
  2023-03-02  9:04   ` Phil Sutter
  2023-03-10 12:18 ` Phil Sutter
  3 siblings, 1 reply; 11+ messages in thread
From: Pablo Neira Ayuso @ 2023-03-01 22:28 UTC (permalink / raw)
  To: Phil Sutter; +Cc: Jozsef Kadlecsik, netfilter-devel

On Wed, Feb 22, 2023 at 06:02:39PM +0100, Phil Sutter wrote:
> These were identified by Coverity tool, no problems in practice. Still
> worth fixing to reduce noise in code checkers.

LGTM.

Did you run ipset xlate tests? These should not break those but just
in case.

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

* Re: [ipset PATCH 0/2] Two minor code fixes
  2023-03-01 22:28 ` [ipset PATCH 0/2] Two minor code fixes Pablo Neira Ayuso
@ 2023-03-02  9:04   ` Phil Sutter
  2023-03-10 11:56     ` Pablo Neira Ayuso
  0 siblings, 1 reply; 11+ messages in thread
From: Phil Sutter @ 2023-03-02  9:04 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Jozsef Kadlecsik, netfilter-devel

On Wed, Mar 01, 2023 at 11:28:36PM +0100, Pablo Neira Ayuso wrote:
> On Wed, Feb 22, 2023 at 06:02:39PM +0100, Phil Sutter wrote:
> > These were identified by Coverity tool, no problems in practice. Still
> > worth fixing to reduce noise in code checkers.
> 
> LGTM.
> 
> Did you run ipset xlate tests? These should not break those but just
> in case.

I didn't, thanks for the reminder. Testsuite fails, but it does with
HEAD as well. And so does the other testsuite ("make tests"), BtW. I'll
investigate.

Cheers, Phil

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

* Re: [ipset PATCH 0/2] Two minor code fixes
  2023-03-02  9:04   ` Phil Sutter
@ 2023-03-10 11:56     ` Pablo Neira Ayuso
  2023-03-10 12:05       ` Phil Sutter
  0 siblings, 1 reply; 11+ messages in thread
From: Pablo Neira Ayuso @ 2023-03-10 11:56 UTC (permalink / raw)
  To: Phil Sutter, Jozsef Kadlecsik, netfilter-devel

On Thu, Mar 02, 2023 at 10:04:14AM +0100, Phil Sutter wrote:
> On Wed, Mar 01, 2023 at 11:28:36PM +0100, Pablo Neira Ayuso wrote:
> > On Wed, Feb 22, 2023 at 06:02:39PM +0100, Phil Sutter wrote:
> > > These were identified by Coverity tool, no problems in practice. Still
> > > worth fixing to reduce noise in code checkers.
> > 
> > LGTM.
> > 
> > Did you run ipset xlate tests? These should not break those but just
> > in case.
> 
> I didn't, thanks for the reminder. Testsuite fails, but it does with
> HEAD as well. And so does the other testsuite ("make tests"), BtW. I'll
> investigate.

Does this work after your testsuite updates? If so, push them out.

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

* Re: [ipset PATCH 0/2] Two minor code fixes
  2023-03-10 11:56     ` Pablo Neira Ayuso
@ 2023-03-10 12:05       ` Phil Sutter
  2023-03-10 12:22         ` Pablo Neira Ayuso
  0 siblings, 1 reply; 11+ messages in thread
From: Phil Sutter @ 2023-03-10 12:05 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Jozsef Kadlecsik, netfilter-devel

On Fri, Mar 10, 2023 at 12:56:29PM +0100, Pablo Neira Ayuso wrote:
> On Thu, Mar 02, 2023 at 10:04:14AM +0100, Phil Sutter wrote:
> > On Wed, Mar 01, 2023 at 11:28:36PM +0100, Pablo Neira Ayuso wrote:
> > > On Wed, Feb 22, 2023 at 06:02:39PM +0100, Phil Sutter wrote:
> > > > These were identified by Coverity tool, no problems in practice. Still
> > > > worth fixing to reduce noise in code checkers.
> > > 
> > > LGTM.
> > > 
> > > Did you run ipset xlate tests? These should not break those but just
> > > in case.
> > 
> > I didn't, thanks for the reminder. Testsuite fails, but it does with
> > HEAD as well. And so does the other testsuite ("make tests"), BtW. I'll
> > investigate.
> 
> Does this work after your testsuite updates? If so, push them out.

Yes, it does. Should I push the testsuite updates, too? I'm uncertain
about the s/vrrp/carp/, don't want to break anyone's test setup.

Cheers, Phil

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

* Re: [ipset PATCH 0/2] Two minor code fixes
  2023-02-22 17:02 [ipset PATCH 0/2] Two minor code fixes Phil Sutter
                   ` (2 preceding siblings ...)
  2023-03-01 22:28 ` [ipset PATCH 0/2] Two minor code fixes Pablo Neira Ayuso
@ 2023-03-10 12:18 ` Phil Sutter
  3 siblings, 0 replies; 11+ messages in thread
From: Phil Sutter @ 2023-03-10 12:18 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter-devel

On Wed, Feb 22, 2023 at 06:02:39PM +0100, Phil Sutter wrote:
> These were identified by Coverity tool, no problems in practice. Still
> worth fixing to reduce noise in code checkers.
> 
> Phil Sutter (2):
>   xlate: Fix for fd leak in error path
>   xlate: Drop dead code

Series applied.

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

* Re: [ipset PATCH 0/2] Two minor code fixes
  2023-03-10 12:05       ` Phil Sutter
@ 2023-03-10 12:22         ` Pablo Neira Ayuso
  2023-03-10 12:37           ` Phil Sutter
  0 siblings, 1 reply; 11+ messages in thread
From: Pablo Neira Ayuso @ 2023-03-10 12:22 UTC (permalink / raw)
  To: Phil Sutter, Jozsef Kadlecsik, netfilter-devel

On Fri, Mar 10, 2023 at 01:05:23PM +0100, Phil Sutter wrote:
> On Fri, Mar 10, 2023 at 12:56:29PM +0100, Pablo Neira Ayuso wrote:
> > On Thu, Mar 02, 2023 at 10:04:14AM +0100, Phil Sutter wrote:
> > > On Wed, Mar 01, 2023 at 11:28:36PM +0100, Pablo Neira Ayuso wrote:
> > > > On Wed, Feb 22, 2023 at 06:02:39PM +0100, Phil Sutter wrote:
> > > > > These were identified by Coverity tool, no problems in practice. Still
> > > > > worth fixing to reduce noise in code checkers.
> > > > 
> > > > LGTM.
> > > > 
> > > > Did you run ipset xlate tests? These should not break those but just
> > > > in case.
> > > 
> > > I didn't, thanks for the reminder. Testsuite fails, but it does with
> > > HEAD as well. And so does the other testsuite ("make tests"), BtW. I'll
> > > investigate.
> > 
> > Does this work after your testsuite updates? If so, push them out.
> 
> Yes, it does. Should I push the testsuite updates, too? I'm uncertain
> about the s/vrrp/carp/, don't want to break anyone's test setup.

I can see some distros still use vrrp en /etc/protocols, yes, I'm
ambivalent on this one.

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

* Re: [ipset PATCH 0/2] Two minor code fixes
  2023-03-10 12:22         ` Pablo Neira Ayuso
@ 2023-03-10 12:37           ` Phil Sutter
  2023-03-10 13:05             ` Pablo Neira Ayuso
  0 siblings, 1 reply; 11+ messages in thread
From: Phil Sutter @ 2023-03-10 12:37 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Jozsef Kadlecsik, netfilter-devel

On Fri, Mar 10, 2023 at 01:22:16PM +0100, Pablo Neira Ayuso wrote:
> On Fri, Mar 10, 2023 at 01:05:23PM +0100, Phil Sutter wrote:
> > On Fri, Mar 10, 2023 at 12:56:29PM +0100, Pablo Neira Ayuso wrote:
> > > On Thu, Mar 02, 2023 at 10:04:14AM +0100, Phil Sutter wrote:
> > > > On Wed, Mar 01, 2023 at 11:28:36PM +0100, Pablo Neira Ayuso wrote:
> > > > > On Wed, Feb 22, 2023 at 06:02:39PM +0100, Phil Sutter wrote:
> > > > > > These were identified by Coverity tool, no problems in practice. Still
> > > > > > worth fixing to reduce noise in code checkers.
> > > > > 
> > > > > LGTM.
> > > > > 
> > > > > Did you run ipset xlate tests? These should not break those but just
> > > > > in case.
> > > > 
> > > > I didn't, thanks for the reminder. Testsuite fails, but it does with
> > > > HEAD as well. And so does the other testsuite ("make tests"), BtW. I'll
> > > > investigate.
> > > 
> > > Does this work after your testsuite updates? If so, push them out.
> > 
> > Yes, it does. Should I push the testsuite updates, too? I'm uncertain
> > about the s/vrrp/carp/, don't want to break anyone's test setup.
> 
> I can see some distros still use vrrp en /etc/protocols, yes, I'm
> ambivalent on this one.

Maybe better just use a different protocol which didn't get "renamed"
recently? It's for testing purposes only and the actual value doesn't
matter much, right?

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

* Re: [ipset PATCH 0/2] Two minor code fixes
  2023-03-10 12:37           ` Phil Sutter
@ 2023-03-10 13:05             ` Pablo Neira Ayuso
  0 siblings, 0 replies; 11+ messages in thread
From: Pablo Neira Ayuso @ 2023-03-10 13:05 UTC (permalink / raw)
  To: Phil Sutter, Jozsef Kadlecsik, netfilter-devel

On Fri, Mar 10, 2023 at 01:37:17PM +0100, Phil Sutter wrote:
> On Fri, Mar 10, 2023 at 01:22:16PM +0100, Pablo Neira Ayuso wrote:
> > On Fri, Mar 10, 2023 at 01:05:23PM +0100, Phil Sutter wrote:
> > > On Fri, Mar 10, 2023 at 12:56:29PM +0100, Pablo Neira Ayuso wrote:
> > > > On Thu, Mar 02, 2023 at 10:04:14AM +0100, Phil Sutter wrote:
> > > > > On Wed, Mar 01, 2023 at 11:28:36PM +0100, Pablo Neira Ayuso wrote:
> > > > > > On Wed, Feb 22, 2023 at 06:02:39PM +0100, Phil Sutter wrote:
> > > > > > > These were identified by Coverity tool, no problems in practice. Still
> > > > > > > worth fixing to reduce noise in code checkers.
> > > > > > 
> > > > > > LGTM.
> > > > > > 
> > > > > > Did you run ipset xlate tests? These should not break those but just
> > > > > > in case.
> > > > > 
> > > > > I didn't, thanks for the reminder. Testsuite fails, but it does with
> > > > > HEAD as well. And so does the other testsuite ("make tests"), BtW. I'll
> > > > > investigate.
> > > > 
> > > > Does this work after your testsuite updates? If so, push them out.
> > > 
> > > Yes, it does. Should I push the testsuite updates, too? I'm uncertain
> > > about the s/vrrp/carp/, don't want to break anyone's test setup.
> > 
> > I can see some distros still use vrrp en /etc/protocols, yes, I'm
> > ambivalent on this one.
> 
> Maybe better just use a different protocol which didn't get "renamed"
> recently? It's for testing purposes only and the actual value doesn't
> matter much, right?

I agree that's fine for a test, yes.

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

end of thread, other threads:[~2023-03-10 13:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22 17:02 [ipset PATCH 0/2] Two minor code fixes Phil Sutter
2023-02-22 17:02 ` [ipset PATCH 1/2] xlate: Fix for fd leak in error path Phil Sutter
2023-02-22 17:02 ` [ipset PATCH 2/2] xlate: Drop dead code Phil Sutter
2023-03-01 22:28 ` [ipset PATCH 0/2] Two minor code fixes Pablo Neira Ayuso
2023-03-02  9:04   ` Phil Sutter
2023-03-10 11:56     ` Pablo Neira Ayuso
2023-03-10 12:05       ` Phil Sutter
2023-03-10 12:22         ` Pablo Neira Ayuso
2023-03-10 12:37           ` Phil Sutter
2023-03-10 13:05             ` Pablo Neira Ayuso
2023-03-10 12:18 ` Phil Sutter

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).