Re: [PATCH 04/10 net-next v3] ipv6: prepare headers for ipv6_stub removal

From: Ido Schimmel

Date: Wed Mar 18 2026 - 08:47:19 EST


On Wed, Mar 18, 2026 at 11:43:40AM +0100, Fernando Fernandez Mancera wrote:
> On 3/17/26 9:12 PM, Ido Schimmel wrote:
> > On Tue, Mar 17, 2026 at 03:01:00PM +0100, Fernando Fernandez Mancera wrote:
> > > diff --git a/include/net/ndisc.h b/include/net/ndisc.h
> > > index d38783a2ce57..6152401f29f1 100644
> > > --- a/include/net/ndisc.h
> > > +++ b/include/net/ndisc.h
> > > @@ -69,6 +69,12 @@ struct prefix_info;
> > > extern struct neigh_table nd_tbl;
> > > +#if IS_ENABLED(CONFIG_IPV6)
> > > +#define ipv6_get_nd_tbl() (&nd_tbl)
> > > +#else
> > > +#define ipv6_get_nd_tbl() NULL
> > > +#endif
> >
> > What is the reason for converting code that is dependent on CONFIG_IPV6
> > to use ipv6_get_nd_tbl()?
>
> I did it mainly for consistency. If you think this isn't fine, I can move it
> back to &nd_tbl directly.

It creates a lot of unnecessary churn throughout the series, so I
wouldn't change code that is currently using '&nd_tbl'. I would also
change 'ipv6_stub->nd_tbl' to '&nd_tbl' if the code is guarded by
IS_ENABLED(CONFIG_IPV6), which is most users.