All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH conntrack 1/2] conntrack: do not ignore errors coming from the kernel
Date: Thu, 18 May 2023 11:18:00 +0200	[thread overview]
Message-ID: <20230518091803.90494-2-pablo@netfilter.org> (raw)
In-Reply-To: <20230518091803.90494-1-pablo@netfilter.org>

Do not ignore error from kernel for command invocation.

e42ea65e9c93 ("conntrack: introduce new -A command") ignores CT_ADD
in print_stats, which should not be required.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/conntrack.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conntrack.c b/src/conntrack.c
index 23eaf274a78a..926213a27efc 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -2886,7 +2886,7 @@ static int print_stats(const struct ct_cmd *cmd)
 		fprintf(stderr, "%s v%s (conntrack-tools): ",PROGNAME,VERSION);
 		fprintf(stderr, exit_msg[cmd->cmd], counter);
 		if (counter == 0 &&
-		    !(cmd->command & (CT_LIST | EXP_LIST | CT_ADD)))
+		    !(cmd->command & (CT_LIST | EXP_LIST)))
 			return -1;
 	}
 
@@ -3835,7 +3835,7 @@ int main(int argc, char *argv[])
 			exit_error(OTHER_PROBLEM, "OOM");
 
 		do_parse(cmd, argc, argv);
-		do_command_ct(argv[0], cmd, sock);
+		res |= do_command_ct(argv[0], cmd, sock);
 		res = print_stats(cmd);
 		free(cmd);
 	}
-- 
2.30.2


  reply	other threads:[~2023-05-18  9:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18  9:17 [PATCH conntrackd 1/3] build: don't suppress various warnings Pablo Neira Ayuso
2023-05-18  9:18 ` Pablo Neira Ayuso [this message]
2023-05-18  9:18 ` [PATCH conntrack 2/2] conntrack: do not silence EEXIST error, use NLM_F_EXCL Pablo Neira Ayuso
2023-05-18  9:18 ` [PATCH conntrackd 2/3] network: Fix -Wstrict-prototypes Pablo Neira Ayuso
2023-05-18  9:32 ` [PATCH conntrackd 1/3] build: don't suppress various warnings Pablo Neira Ayuso
  -- strict thread matches above, loose matches on Subject: below --
2023-05-18  9:18 [PATCH conntrack 1/2] conntrack: do not ignore errors coming from the kernel 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=20230518091803.90494-2-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.