Bug 211386 - Kernel build fails when TCP_RFC7413 option set
Summary: Kernel build fails when TCP_RFC7413 option set
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.0-STABLE
Hardware: amd64 Any
: Normal Affects Some People
Assignee: Mike Karels
Keywords: easy, needs-qa, patch, regression
Depends on:
Reported: 2016-07-26 16:11 UTC by iron.udjin
Modified: 2016-08-15 04:27 UTC (History)
6 users (show)

See Also:
koobs: mfc-stable11+
koobs: mfc-stable10?

BT kernel config (14.47 KB, text/plain)
2016-07-27 07:13 UTC, iron.udjin
no flags Details
bug211386_tcp_fastopen.c.patch (300 bytes, patch)
2016-08-09 19:27 UTC, iron.udjin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description iron.udjin 2016-07-26 16:11:17 UTC

I'm trying to build kernel 11-STABLE r303338 and it failes to build wnen I have in config file:

options         TCP_RFC7413

Here is build log:

cc -target x86_64-unknown-freebsd11.0 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin -c -O3 -pipe -march=native -fno-strict-aliasing -march=native  -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -MD  -MF.depend.tcp_fastopen.o -MTtcp_fastopen.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-unknown-pragmas  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -Wno-error-pointer-sign -Wno-error-shift-negative-value  -mno-aes -mno-avx  -std=iso9899:1999 -Werror  /usr/src/sys/netinet/tcp_fastopen.c
In file included from /usr/src/sys/netinet/tcp_fastopen.c:120:
In file included from /usr/src/sys/netinet/in_pcb.h:45:
/usr/src/sys/net/route.h:63:18: error: field has incomplete type 'struct sockaddr'
        struct  sockaddr ro_dst;
/usr/src/sys/sys/sockbuf.h:64:8: note: forward declaration of 'struct sockaddr'
struct sockaddr;
1 error generated.
*** Error code 1

bmake[2]: stopped in /usr/obj/usr/src/sys/BT
*** Error code 1

bmake[1]: stopped in /usr/src
*** Error code 1

make: stopped in /usr/src
Comment 1 Enji Cooper freebsd_committer 2016-07-26 23:51:14 UTC
Please include your KERNCONF.
Comment 2 iron.udjin 2016-07-27 07:13:44 UTC
Created attachment 173029 [details]
BT kernel config
Comment 3 Sergey Kandaurov freebsd_committer 2016-08-02 21:53:16 UTC
This is a probable fallout from r297225, which is confirmed
by that TCP_RFC7413 is successfully built on stable/10
that doesn't have net/route.h in netinet/in_pcb.h.
You can try to workaround it with <sys/socket.h> inclusion
from tcp_fastopen.c
Comment 4 iron.udjin 2016-08-04 21:05:54 UTC
(In reply to Sergey Kandaurov from comment #3)

Thank you for workaround. I just tested it and it works fine. Here is patch:

--- sys/netinet/tcp_fastopen.c.orig	2016-08-04 15:04:22.000000000 -0600
+++ sys/netinet/tcp_fastopen.c	2016-08-04 15:03:57.000000000 -0600
@@ -111,6 +111,7 @@
 #include <sys/socketvar.h>
 #include <sys/sysctl.h>
 #include <sys/systm.h>
+#include <sys/socket.h>
 #include <crypto/siphash/siphash.h>
Comment 5 Eric van Gyzen freebsd_committer 2016-08-08 15:27:53 UTC
Who is going to commit the patch?
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2016-08-08 15:48:55 UTC
The original commit was 4 months ago, so I'm assuming this needs to be fixed in the 11.0 branches pending release (cc re@). Note sure if it was ever MFC's, but set mfc-stable10 in case it was.

Assign original committer of r297225 for resolution or re-assignment

Can someone include the proposed patch as an attachment please
Comment 7 iron.udjin 2016-08-09 19:27:43 UTC
Created attachment 173472 [details]
Comment 8 Eric van Gyzen freebsd_committer 2016-08-12 16:08:21 UTC
Fixed by r303978.

Comment 9 Kubilay Kocak freebsd_committer freebsd_triage 2016-08-12 16:12:39 UTC
Assign to committer resolving.

Pending MFC's
Comment 10 Mike Karels freebsd_committer 2016-08-14 19:44:26 UTC
Marking as closed, hope that is right; fixes are on 12-CURRENT, 11-stable, and release/11.0.
Comment 11 Kubilay Kocak freebsd_committer freebsd_triage 2016-08-15 04:27:02 UTC

If stable/10 is affected it should be MFC'd there (set mfc-stable10 flag to + when committed), unless it cannot be due to $reasons (set mfc-stable10 flag to - with comment)

I've just set mfc-stable11 flag to + (as its been merged there).

If you could also add a comment with links (svnweb) to the MFC (merge) commits that would be great, as "PR: XXXXX" references were not included in the commit messages, which would have automatically added them here.