Subject: Re: [linux-next:master] [net] d288a162dd: canonical_address#:#[##]

From: David Ahern <[email-masked]>
Date: Tue, 18 Apr 2023 14:43:02 -0600

On 4/18/23 10:41 AM, Leon Romanovsky wrote:
> Hi,
> 
> I came to the following diff which eliminates the kernel panics,
> unfortunately I can explain only second hunk, but first is required
> too.
> 
> diff --git a/net/core/dst.c b/net/core/dst.c
> index 3247e84045ca..750c8edfe29a 100644
> --- a/net/core/dst.c
> +++ b/net/core/dst.c
> @@ -72,6 +72,8 @@ void dst_init(struct dst_entry *dst, struct dst_ops *ops,
>         dst->flags = flags;
>         if (!(flags & DST_NOCOUNT))
>                 dst_entries_add(ops, 1);
> +
> +       INIT_LIST_HEAD(&dst->rt_uncached);

d288a162dd1c73507da582966f17dd226e34a0c0 moved rt_uncached from rt6_info
and rtable to dst_entry. Only ipv4 and ipv6 usages initialize it. Since
it is now in dst_entry, dst_init is the better place so it can be
removed from rt_dst_alloc and rt6_info_init.