All of lore.kernel.org
 help / color / mirror / Atom feed
From: Flavio Leitner <fbl@redhat.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netdev@vger.kernel.org, Joe Stringer <joe@ovn.org>,
	Pravin B Shelar <pshelar@ovn.org>,
	dev@openvswitch.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/8] netfilter: add API to manage NAT helpers.
Date: Mon, 15 Apr 2019 11:05:54 -0300	[thread overview]
Message-ID: <20190415140554.GG3319@p50.lan> (raw)
In-Reply-To: <20190415055034.k23xtziyu64ywazj@salvia>

On Mon, Apr 15, 2019 at 07:50:34AM +0200, Pablo Neira Ayuso wrote:
> On Sat, Apr 13, 2019 at 08:17:10PM -0300, Flavio Leitner wrote:
> [...]
> > +void nf_nat_helper_put(struct nf_conntrack_helper *helper)
> > +{
> > +	struct nf_conntrack_nat_helper *nat;
> > +
> > +	nat = nf_conntrack_nat_helper_find(helper->nat_mod_name);
> > +	BUG_ON(nat == NULL);
> 
> We've been trying to avoid BUG_ON() in many spots recently. Could you
> turn this into... ?
> 
>         if (WARN_ON(!nat))
>                 return;

OK.


> 
> > +	module_put(nat->module);
> > +}
> > +EXPORT_SYMBOL_GPL(nf_nat_helper_put);
> > +
> >  struct nf_conn_help *
> >  nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp)
> >  {
> > @@ -430,6 +502,10 @@ void nf_ct_helper_init(struct nf_conntrack_helper *helper,
> >  	helper->help = help;
> >  	helper->from_nlattr = from_nlattr;
> >  	helper->me = module;
> > +	helper->nat_mod_name[0] = '\0';
> > +	if (name)
> > +		snprintf(helper->nat_mod_name, sizeof(helper->nat_mod_name),
> > +			 NF_NAT_HELPER_PREFIX"%s", name);
> >  
> >  	if (spec_port == default_port)
> >  		snprintf(helper->name, sizeof(helper->name), "%s", name);
> > @@ -466,6 +542,26 @@ void nf_conntrack_helpers_unregister(struct nf_conntrack_helper *helper,
> >  }
> >  EXPORT_SYMBOL_GPL(nf_conntrack_helpers_unregister);
> >  
> > +void nf_nat_helper_register(struct nf_conntrack_nat_helper *nat)
> > +{
> > +	BUG_ON(nat->module == NULL);
> 
> Same here.


OK, no problem.

> 
> > +
> > +	mutex_lock(&nf_ct_nat_helpers_mutex);
> > +	list_add_rcu(&nat->list, &nf_ct_nat_helpers);
> > +	mutex_unlock(&nf_ct_nat_helpers_mutex);
> > +}
> > +EXPORT_SYMBOL_GPL(nf_nat_helper_register);
> > +
> > +void nf_nat_helper_unregister(struct nf_conntrack_nat_helper *nat)
> > +{
> > +	BUG_ON(nat->module == NULL);
> 
> And here.

Sure.
Thanks!
fbl

> 
> Thanks.

  reply	other threads:[~2019-04-15 14:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-13 23:17 [PATCH net-next v2 0/8] openvswitch: load and reference the NAT helper Flavio Leitner
2019-04-13 23:17 ` [PATCH net-next v2 1/8] netfilter: use macros to create module aliases Flavio Leitner
2019-04-13 23:17 ` [PATCH net-next v2 2/8] netfilter: add API to manage NAT helpers Flavio Leitner
2019-04-15  5:48   ` Pablo Neira Ayuso
2019-04-15 14:04     ` Flavio Leitner
2019-04-15  5:50   ` Pablo Neira Ayuso
2019-04-15 14:05     ` Flavio Leitner [this message]
2019-04-13 23:17 ` [PATCH net-next v2 3/8] netfilter: nf_nat: register amanda NAT helper Flavio Leitner
2019-04-13 23:17 ` [PATCH net-next v2 4/8] netfilter: nf_nat: register ftp " Flavio Leitner
2019-04-13 23:17 ` [PATCH net-next v2 5/8] netfilter: nf_nat: register irc " Flavio Leitner
2019-04-13 23:17 ` [PATCH net-next v2 6/8] netfilter: nf_nat: register sip " Flavio Leitner
2019-04-13 23:17 ` [PATCH net-next v2 7/8] netfilter: nf_nat: register tftp " Flavio Leitner
2019-04-13 23:17 ` [PATCH net-next v2 8/8] openvswitch: load and reference the " Flavio Leitner

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=20190415140554.GG3319@p50.lan \
    --to=fbl@redhat.com \
    --cc=dev@openvswitch.org \
    --cc=joe@ovn.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=pshelar@ovn.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.