Re: [PATCH 00/11 net-next v4] Convert CONFIG_IPV6 to built-in and remove stubs

From: David Ahern

Date: Mon Mar 23 2026 - 12:16:47 EST


On 3/23/26 6:19 AM, Fernando Fernandez Mancera wrote:
> On 3/22/26 6:27 PM, Ido Schimmel wrote:
>> On Fri, Mar 20, 2026 at 07:55:52PM +0100, Fernando Fernandez Mancera
>> wrote:
>>> Changes:
>>>    v4:
>>>      Patch 2: new patch introduced on this revision
>>>      Patch 3: drop some IS_BUILTIN(IPV6) on files compiled only when
>>> IPV6=y
>>>      Patch 5: introduce ipv6_mod_enabled() checks on fib6_nh_init(),
>>> ip6_dst_lookup_flow() and ip6_fragment() to avoid crash when
>>> ipv6.disable=1 during boot
>>>      Patch 6: use &nd_tbl on code guarded by IS_ENABLED(CONFIG_IPV6)
>>
>> The IPv6 code is still using ipv6_get_nd_tbl() for some reason. If you
>> remove it from there (it's not needed), then we are only left with
>> handful of users that can be converted to use '&nd_tbl' when IPv6 is
>> enabled. Something like the patch below.
>>
> Hi Ido, the main reason why ipv6_get_nd_tbl() is used on IPv6 code is
> due to inlined functions. __ipv6_neigh_lookup_noref() is used in several
> places not guarded by IS_ENABLED(CONFIG_IPV6) preprocessor directive.
> That leads to undefined references when compiling with CONFIG_IPV6=n.
>
> ld: vmlinux.o: in function `bpf_ipv4_fib_lookup':
> filter.c:(.text+0x322b9dc): undefined reference to `nd_tbl'
> ld: filter.c:(.text+0x322b9fb): undefined reference to `nd_tbl'
> ld: filter.c:(.text+0x322ce1a): undefined reference to `nd_tbl'
> ld: vmlinux.o: in function `ipv4_confirm_neigh':
> route.c:(.text+0x345ade7): undefined reference to `nd_tbl'
> ld: route.c:(.text+0x345ae06): undefined reference to `nd_tbl'
> ld: vmlinux.o:route.c:(.text+0x345b74f): more undefined references to
> `nd_tbl' follow

are these errors with Ido's suggested additional change?