Re: [PATCH nf-next,v2 3/5] net: do not advance stack index from dev_fwd_path()

Pablo Neira Ayuso <[email protected]> Mon, 27 Jul 2026 16:25:12 +0200
Newsgroups gmane.comp.security.firewalls.netfilter.devel
Message-ID <amdqSFbQNIl863xq@chamomile>
On Mon, Jul 27, 2026 at 02:42:19PM +0200, Lorenzo Bianconi wrote:
[...]
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index c1c1be1a6962..ca65d1dcd604 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -742,9 +742,9 @@ EXPORT_SYMBOL_GPL(dev_fill_metadata_dst);
> >  
> >  static struct net_device_path *dev_fwd_path(struct net_device_path_stack *stack)
> >  {
> > -	int k = stack->num_paths++;
> > +	int k = stack->num_paths;
> >  
> > -	if (k >= NET_DEVICE_PATH_STACK_MAX)
> > +	if (k + 1 >= NET_DEVICE_PATH_STACK_MAX)
> 
> nit: do we really need k in this case? (ignore the comment if you do not
> need to repost).

Yes, I can do that. I will have to repost anyway, sashiko did not kick in.