From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [nf-next PATCH] netfilter: nft_masq: fix register/unregister notifier on module _init and _exit
Date: Fri, 3 Oct 2014 15:16:18 +0200 [thread overview]
Message-ID: <20141003131618.GA3353@salvia> (raw)
In-Reply-To: <20141003121335.2864.5519.stgit@nfdev.cica.es>
On Fri, Oct 03, 2014 at 02:13:36PM +0200, Arturo Borrero Gonzalez wrote:
> Let's mimic the behaviour of ipt_MASQUERADE and ip6t_MASQUERADE and
> register/unregister the masquerade notifiers on module _init and _exit.
>
> The configuration previous to this patch may lead to spurious kernel crashes.
Applied, thanks Arturo.
I have slightly rewritten the patch title and description.
And another comment below:
> @@ -73,12 +52,19 @@ static struct nft_expr_type nft_masq_ipv4_type __read_mostly = {
>
> static int __init nft_masq_ipv4_module_init(void)
> {
> - return nft_register_expr(&nft_masq_ipv4_type);
> + int ret;
> +
> + ret = nft_register_expr(&nft_masq_ipv4_type);
> + if (ret == 0)
> + nf_nat_masquerade_ipv4_register_notifier();
The convention is to check for errors, ie.
ret = foo();
if (ret < 0)
return ret;
bar();
So the branch path returns the error or goes to error handling part to
undo things that we couldn't finish.
prev parent reply other threads:[~2014-10-03 13:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-03 12:13 [nf-next PATCH] netfilter: nft_masq: fix register/unregister notifier on module _init and _exit Arturo Borrero Gonzalez
2014-10-03 13:16 ` Pablo Neira Ayuso [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=20141003131618.GA3353@salvia \
--to=pablo@netfilter.org \
--cc=arturo.borrero.glez@gmail.com \
--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.