All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Joe Stringer <joestringer@nicira.com>
Cc: Florian Westphal <fw@strlen.de>,
	netfilter-devel@vger.kernel.org,
	Linux Netdev List <netdev@vger.kernel.org>,
	Andy Zhou <azhou@nicira.com>
Subject: Re: [PATCH nf-next 4/4] netfilter: ipv6: avoid nf_iterate recursion
Date: Tue, 20 Oct 2015 10:18:37 +0200	[thread overview]
Message-ID: <20151020081837.GI4386@breakpoint.cc> (raw)
In-Reply-To: <CANr6G5z3SYGo-f7OmKwncHFK0M01YkeWk2W9tPcQWX3LV5NEEA@mail.gmail.com>

Joe Stringer <joestringer@nicira.com> wrote:
> On 17 October 2015 at 13:14, Florian Westphal <fw@strlen.de> wrote:
> > @@ -606,19 +599,22 @@ struct sk_buff *nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 use
> >                 spin_unlock_bh(&fq->q.lock);
> >                 pr_debug("Can't insert skb to queue\n");
> >                 inet_frag_put(&fq->q, &nf_frags);
> > -               return skb;
> > +               return -EINVAL;
> >         }
> >
> > +       /* after queue has assumed skb ownership, only 0 or -EINPROGRESS
> > +        * must be returned.
> > +        */
> > +       ret = -EINPROGRESS;
> >         if (fq->q.flags == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
> > -           fq->q.meat == fq->q.len) {
> > -               ret_skb = nf_ct_frag6_reasm(fq, skb, dev);
> > -               if (ret_skb == NULL)
> > -                       pr_debug("Can't reassemble fragmented packets\n");
> > -       }
> > +           fq->q.meat == fq->q.len &&
> > +           nf_ct_frag6_reasm(fq, skb, dev))
> > +               ret = 0;
> > +
> >         spin_unlock_bh(&fq->q.lock);
> >
> >         inet_frag_put(&fq->q, &nf_frags);
> > -       return ret_skb;
> > +       return ret;
> >  }
> >  EXPORT_SYMBOL_GPL(nf_ct_frag6_gather);
> 
> Minor nit below, feel free to disregard if it misses some code style
> guideline. The lock/unlock reads easier to me if the
> unlocking/frag_put is grouped together, something like the following
> incremental:

I like it, will change it for v2.

Thanks!

  reply	other threads:[~2015-10-20  8:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-17 20:14 [PATCH nf-next 0/4] netfilter: rework netfilter ipv6 defrag Florian Westphal
2015-10-17 20:14 ` [PATCH nf-next 1/4] netfilter: ipv6: remove extra clone/free operations Florian Westphal
2015-10-17 20:14 ` [PATCH nf-next 2/4] inet: kill obsolete skb_free op Florian Westphal
2015-10-17 20:14 ` [PATCH nf-next 3/4] netfilter: ipv6: in-place replacement of last skb Florian Westphal
2015-10-20 18:39   ` Joe Stringer
2015-10-20 20:46     ` Florian Westphal
2015-10-17 20:14 ` [PATCH nf-next 4/4] netfilter: ipv6: avoid nf_iterate recursion Florian Westphal
2015-10-20  6:25   ` Joe Stringer
2015-10-20  8:18     ` Florian Westphal [this message]
2015-10-20  6:16 ` [PATCH nf-next 0/4] netfilter: rework netfilter ipv6 defrag Joe Stringer
2015-10-20  8:17   ` Florian Westphal
2015-10-20 18:43     ` Joe Stringer
2015-10-20 20:53       ` Florian Westphal
2015-10-20 23:59         ` Joe Stringer
2015-10-21 12:42         ` Pablo Neira Ayuso
2015-10-21 14:50           ` Florian Westphal
2015-10-21 16:52             ` Joe Stringer
2015-10-21 14:34 ` David Miller

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=20151020081837.GI4386@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=azhou@nicira.com \
    --cc=joestringer@nicira.com \
    --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.