Subject: Re: [PATCH/RFC rocker-net-next 1/6] net: flow: Cancel innermost nested attribute first

From: Simon Horman <[email-masked]>
Date: Tue, 6 Jan 2015 10:03:21 +0900

On Mon, Jan 05, 2015 at 04:17:25PM -0500, David Miller wrote:
> From: Simon Horman <[email-masked]>
> Date: Mon,  5 Jan 2015 15:50:05 +0900
> 
> > Cancel innermost nested attribute first on error when putting flow actions.
> > 
> > Signed-off-by: Simon Horman <[email-masked]>
> > 
> > ---
> > 
> > Its unclear to me if this makes any difference.
> > But it seems more logical to me.
> 
> Hmmm.  Be careful here.  nla_nest_cancel() is just rolling back
> the length of the SKB to right before the netlink attribute being
> given as the cancellation point.
> 
> So you really have to cancel attributes in exactly the reverse order
> in which they were added.  Otherwise we'll make a trim call with a
> negative adjustment that actually expands the SKB past an already
> cancelled attribute.

Thanks for clarifying that.

The aim of my patch is to perform the roll back in reverse order
which I now know is required.