lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250416185809.1695-1-kuniyu@amazon.com>
Date: Wed, 16 Apr 2025 11:58:07 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <pabeni@...hat.com>
CC: <davem@...emloft.net>, <dsahern@...nel.org>, <edumazet@...gle.com>,
	<horms@...nel.org>, <kuba@...nel.org>, <kuni1840@...il.com>,
	<kuniyu@...zon.com>, <netdev@...r.kernel.org>
Subject: Re: [PATCH RESEND v2 net-next 10/14] ipv6: Factorise ip6_route_multipath_add().

From: Paolo Abeni <pabeni@...hat.com>
Date: Wed, 16 Apr 2025 11:57:23 +0200
> On 4/14/25 8:14 PM, Kuniyuki Iwashima wrote:
> > diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> > index 49eea7e1e2da..c026f8fe5f78 100644
> > --- a/net/ipv6/route.c
> > +++ b/net/ipv6/route.c
> > @@ -5315,29 +5315,131 @@ struct rt6_nh {
> >  	struct fib6_info *fib6_info;
> >  	struct fib6_config r_cfg;
> >  	struct list_head next;
> > +	int weight;
> >  };
> >  
> > -static int ip6_route_info_append(struct list_head *rt6_nh_list,
> > -				 struct fib6_info *rt,
> > -				 struct fib6_config *r_cfg)
> > +static void ip6_route_mpath_info_cleanup(struct list_head *rt6_nh_list)
> >  {
> > -	struct rt6_nh *nh;
> > -	int err = -EEXIST;
> > +	struct rt6_nh *nh, *nh_next;
> >  
> > -	list_for_each_entry(nh, rt6_nh_list, next) {
> > -		/* check if fib6_info already exists */
> > -		if (rt6_duplicate_nexthop(nh->fib6_info, rt))
> > -			return err;
> > +	list_for_each_entry_safe(nh, nh_next, rt6_nh_list, next) {
> > +		struct fib6_info *rt = nh->fib6_info;
> > +
> > +		if (rt) {
> > +			free_percpu(rt->fib6_nh->nh_common.nhc_pcpu_rth_output);
> > +			free_percpu(rt->fib6_nh->rt6i_pcpu);
> > +			ip_fib_metrics_put(rt->fib6_metrics);
> > +			kfree(rt);
> > +		}
> > +
> > +		list_del(&nh->next);
> 
> Somewhat unrelated, but the field 'next' has IMHO a quite misleading
> name, and it would be great to rename it to something else ('list'),
> could you please consider including such change?

Had the same feeling :)

Will add a patch or post a follow if the series gets over 15.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ