[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151020081837.GI4386@breakpoint.cc>
Date: Tue, 20 Oct 2015 10:18:37 +0200
From: Florian Westphal <fw@...len.de>
To: Joe Stringer <joestringer@...ira.com>
Cc: Florian Westphal <fw@...len.de>, netfilter-devel@...r.kernel.org,
Linux Netdev List <netdev@...r.kernel.org>,
Andy Zhou <azhou@...ira.com>
Subject: Re: [PATCH nf-next 4/4] netfilter: ipv6: avoid nf_iterate recursion
Joe Stringer <joestringer@...ira.com> wrote:
> On 17 October 2015 at 13:14, Florian Westphal <fw@...len.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!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists