Bug 255389

Summary: FIB_ALGO fails to build without INET6
Product: Base System Reporter: Jan Beich <jbeich>
Component: kernAssignee: Alexander V. Chernikov <melifaro>
Status: Closed FIXED    
Severity: Affects Only Me CC: 2khramtsov, melifaro
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
blind fix (apply via "git am") none

Description Jan Beich freebsd_committer freebsd_triage 2021-04-25 10:25:08 UTC
Created attachment 224416 [details]
blind fix (apply via "git am")

Exposed by src 6993187a8c30

$ cat sys/amd64/conf/MYKERNEL
include GENERIC-NODEBUG
ident MYKERNEL
nooption INET6

$ make -j8 buildkernel
[...]
--- kernel.full ---
linking kernel.full
ld: error: undefined symbol: vnet_entry_inet6_dp
>>> referenced by pcpu_aux.h:0 (sys/amd64/include/pcpu_aux.h:0)
>>>               fib_algo.o:(fib_set_datapath_ptr)
>>> referenced by fib_algo.c:0 (sys/net/route/fib_algo.c:0)
>>>               fib_algo.o:(fib_select_algo_initial)
>>> did you mean: vnet_entry_inet_dp
>>> defined in: in_fib.o

ld: error: undefined symbol: rt_get_inet6_prefix_plen
>>> referenced by fib_algo.c:713 (sys/net/route/fib_algo.c:713)
>>>               fib_algo.o:(queue_rtable_change)
*** [kernel.full] Error code 1

make[2]: stopped in /usr/obj/amd64.amd64/sys/NONGENERIC
Comment 1 commit-hook freebsd_committer freebsd_triage 2021-04-25 11:29:53 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=67372fb3e06ebaccfe7c093aa78009d161fa58e6

commit 67372fb3e06ebaccfe7c093aa78009d161fa58e6
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2021-04-21 01:45:49 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2021-04-21 01:49:18 +0000

    Fix NOINET[6] build after enabling FIB_ALGO in GENERIC.

    Submitted by:   jbeich
    PR:             255389

 sys/net/route/fib_algo.c | 4 ++++
 1 file changed, 4 insertions(+)
Comment 2 Jan Beich freebsd_committer freebsd_triage 2021-04-25 12:31:22 UTC
comment 1 doesn't include VIMAGE (also in GENERIC) fix from attachment 224416 [details], so I can still reproduce:

linking kernel.full
ld: error: undefined symbol: vnet_entry_inet6_dp
>>> referenced by pcpu_aux.h:0 (sys/amd64/include/pcpu_aux.h:0)
>>>               fib_algo.o:(fib_set_datapath_ptr)
>>> referenced by fib_algo.c:0 (sys/net/route/fib_algo.c:0)
>>>               fib_algo.o:(fib_select_algo_initial)
>>> did you mean: vnet_entry_inet_dp
>>> defined in: in_fib.o
Comment 3 Ghost 2021-04-25 19:44:06 UTC
The second part of Jan's fix also unbreaks the "nooptions INET" kernel build.
Comment 4 Jan Beich freebsd_committer freebsd_triage 2021-04-27 06:03:59 UTC
I confirm, builds fine after https://cgit.FreeBSD.org/src/commit/?id=7d222ce3c10bdc23c8dc92d6b13e376ede5840d5

Commit messages could've been better if you've applied like

$ fetch -o /tmp/bug255389.diff 'https://bugs.freebsd.org/bugzilla/attachment.cgi?id=224416'
$ git am /tmp/bug255389.diff
$ git commit --amend # add missing tags or reword
$ git log -p --pretty=fuller @{u}.. # check everything is sane
$ git push --push-option=confirm-author freebsd
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-04-29 09:18:08 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a423e945c70b55d449d155997ec3d8d0e2cb6716

commit a423e945c70b55d449d155997ec3d8d0e2cb6716
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2021-04-21 01:45:49 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2021-04-29 08:47:32 +0000

    Fix NOINET[6] build after enabling FIB_ALGO in GENERIC.

    Submitted by:   jbeich
    PR:             255389

    (cherry picked from commit 67372fb3e06ebaccfe7c093aa78009d161fa58e6)

 sys/net/route/fib_algo.c | 4 ++++
 1 file changed, 4 insertions(+)