netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: "Gérald Colangelo" <gerald.colangelo@weblib.eu>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: Bug in ulogd2 when destroying a stack that failed to start (with fix attached)
Date: Wed, 12 Mar 2025 09:49:56 +0100	[thread overview]
Message-ID: <Z9FKtEEoHCsCJ5wl@strlen.de> (raw)
In-Reply-To: <CAEqktHuJ7T8R6CmYd-R7tufUPdLBT22S6G3_-_PG9s9c_4t5EA@mail.gmail.com>

Gérald Colangelo <gerald.colangelo@weblib.eu> wrote:
> +cleanup_fail:
> +	stop = pi;
> +	llist_for_each_entry(pi, &stack->list, list) {
> +		if (pi == stop)
> +			/* the one that failed, stops the cleanup here */
> +			break;
> +		if (!pi->plugin->stop) 
> +			continue;
> +		ret = pi->plugin->stop(pi);
> +		if (ret < 0) {
> +			ulogd_log(ULOGD_ERROR,
> +			"error stopping `%s'\n",
> +			pi->id);
> +		}
> +	}
> +	return -1;

Looks good, but I think you also need to add a second loop to free()
the stack elements, as done in stop_pluginstances().


      reply	other threads:[~2025-03-12  8:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 17:10 Bug in ulogd2 when destroying a stack that failed to start (with fix attached) Gérald Colangelo
2025-03-12  8:49 ` Florian Westphal [this message]

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=Z9FKtEEoHCsCJ5wl@strlen.de \
    --to=fw@strlen.de \
    --cc=gerald.colangelo@weblib.eu \
    --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 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).