From: Pablo Neira Ayuso <pablo@netfilter.org>
To: fgao@ikuai8.com
Cc: kaber@trash.net, netfilter-devel@vger.kernel.org,
netdev@vger.kernel.org, gfree.wind@gmail.com
Subject: Re: [PATCH 1/1] netfilter: Use IS_ERR_OR_NULL instead of IS_ERR and NULl check to simplify the codes in ip_vs_genl_dump_dests and resolve_normal_ct
Date: Thu, 21 Jul 2016 19:01:00 +0200 [thread overview]
Message-ID: <20160721170100.GA11613@salvia> (raw)
In-Reply-To: <20160721164553.GA10667@salvia>
On Thu, Jul 21, 2016 at 06:45:53PM +0200, Pablo Neira Ayuso wrote:
> > diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
> > index 153e33f..634d592 100644
> > --- a/net/netfilter/nf_conntrack_core.c
> > +++ b/net/netfilter/nf_conntrack_core.c
> > @@ -1108,10 +1108,8 @@ resolve_normal_ct(struct net *net, struct nf_conn *tmpl,
> > if (!h) {
> > h = init_conntrack(net, tmpl, &tuple, l3proto, l4proto,
> > skb, dataoff, hash);
> > - if (!h)
> > - return NULL;
> > - if (IS_ERR(h))
> > - return (void *)h;
> > + if (IS_ERR_OR_NULL(h))
> > + return ERR_CAST(h);
>
> Interesting.
>
> I think we can actually simplify this patch, I'm sending a patch for
> this now.
Forget this, I cannot actually achieve the simplification, we need the
ENOMEM to drop packets when we're under stress.
next prev parent reply other threads:[~2016-07-21 17:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-21 14:09 [PATCH 1/1] netfilter: Use IS_ERR_OR_NULL instead of IS_ERR and NULl check to simplify the codes in ip_vs_genl_dump_dests and resolve_normal_ct fgao
2016-07-21 16:45 ` Pablo Neira Ayuso
2016-07-21 17:01 ` Pablo Neira Ayuso [this message]
2016-07-21 16:54 ` 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=20160721170100.GA11613@salvia \
--to=pablo@netfilter.org \
--cc=fgao@ikuai8.com \
--cc=gfree.wind@gmail.com \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.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.