net: Consolidate metrics handling for ipv4 and ipv6
Subsystems (3)
David Miller
maintainerFrom: David Ahern <[email protected]>
Date: Thu, 4 Oct 2018 20:07:50 -0700
Quoted 10 lines
From: David Ahern <[email protected]>
As part of the IPv6 fib info refactoring, the intent was to make metrics handling for ipv6 identical to ipv4. One oversight in
ip6_dst_destroyled to confusion and a couple of incomplete attempts at finding and fixing the resulting memory leak which was ultimately resolved byce7ea4af0838("ipv6: fix memory leak ondst->_metrics").Refactor metrics hanlding make the code really identical for v4 and v6, and add a few test cases.
Looks nice, series applied, thanks David.
Quoted 11 lines · David Miller
From: David Ahern <[email protected]>
Date: Thu, 4 Oct 2018 20:07:50 -0700Quoted 8 lines
From: David Ahern <[email protected]>
As part of the IPv6 fib info refactoring, the intent was to make metrics handling for ipv6 identical to ipv4. One oversight in
ip6_dst_destroyled to confusion and a couple of incomplete attempts at finding and fixing the resulting memory leak which was ultimately resolved byce7ea4af0838("ipv6: fix memory leak ondst->_metrics").
Quoted 5 lines
Quoted 2 lines
Refactor metrics hanlding make the code really identical for v4 and v6, and add a few test cases.
Looks nice, series applied, thanks David.
Does not look well tested and reviewed to me.
Quoted 14 lines · Eric Dumazet
Quoted 11 lines · David Miller
From: David Ahern <[email protected]>
Date: Thu, 4 Oct 2018 20:07:50 -0700Quoted 8 lines
From: David Ahern <[email protected]>
As part of the IPv6 fib info refactoring, the intent was to make metrics handling for ipv6 identical to ipv4. One oversight in
ip6_dst_destroyled to confusion and a couple of incomplete attempts at finding and fixing the resulting memory leak which was ultimately resolved byce7ea4af0838("ipv6: fix memory leak ondst->_metrics").
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Refactor metrics hanlding make the code really identical for v4 and v6, and add a few test cases.
Looks nice, series applied, thanks David.
Does not look well tested and reviewed to me.
For some reason I have not received the patch series in my inbox, I only got your "series applied" message.
Commit 767a2217533fed6 ("net: common metrics init helper for FIB entries") is not correct because we need to better deal with error paths.
I will submit this more formally when I can reach my workstation in a few minutes :
net/ipv6/route.c +2 -0
@@ -2976,6 +2976,8 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg, rt->fib6_metrics =ip_fib_metrics_init (net, cfg->fc_mx, cfg->fc_mx_len);if (IS_ERR (rt->fib6_metrics)) { err =PTR_ERR (rt->fib6_metrics); +/* Do not leave garbage there. */ + rt->fib6_metrics = (struct dst_metrics *)&dst_default_metrics; goto out; }
Quoted 11 lines · Eric Dumazet
Commit
767a2217533fed6("net: common metrics init helper for FIB entries") is not correct because we need to better deal with error paths.I will submit this more formally when I can reach my workstation in a few minutes :
net/ipv6/route.c +0
-0
net/ipv6/route.c static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg, · line 2983
Quoted 8 lines
net/ipv6/route.c +2
-0@@ -2976,6 +2976,8 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg, rt->fib6_metrics =ip_fib_metrics_init (net, cfg->fc_mx, cfg->fc_mx_len);if (IS_ERR (rt->fib6_metrics)) { err =PTR_ERR (rt->fib6_metrics); +/* Do not leave garbage there. */ + rt->fib6_metrics = (struct dst_metrics *)&dst_default_metrics; goto out; }
Yes, I was focused on the memory leaks and cleanup and forgot to purposely fail the alloc for the metrics. The above is one way to fix it. Thanks for spotting it.
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Fri, 5 Oct 2018 06:08:57 -0700
Quoted 2 lines
For some reason I have not received the patch series in my inbox, I only got your "series applied" message.
I see what happened.
I did something stupid on vger.kernel.org yesterday which ran a partition out of disk space, and some postings got lost as a result.
Sorry about that.
Quoted 4 lines
Commit
767a2217533fed6("net: common metrics init helper for FIB entries") is not correct because we need to better deal with error paths.I will submit this more formally when I can reach my workstation in a few minutes :
Thanks Eric.