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

From: Fernando Fernandez Mancera

Date: Wed Mar 18 2026 - 09:03:14 EST


On 3/18/26 1:45 PM, Ido Schimmel wrote:
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.


Fair enough. I will adjust it. Anyway, for the code not guarded by IS_ENABLED(CONFIG_IPV6) and that was using ipv6_stub the ipv6_get_nd_tbl() is still necessary.

Thank you for the feedback!