Page MenuHomeFreeBSD

tcp: restrict the contents of tcp_timer.h to the kernel context
ClosedPublic

Authored by tuexen on Jun 17 2025, 8:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 5, 9:53 PM
Unknown Object (File)
Thu, Oct 30, 11:38 PM
Unknown Object (File)
Wed, Oct 22, 11:27 PM
Unknown Object (File)
Wed, Oct 22, 2:12 PM
Unknown Object (File)
Wed, Oct 22, 5:09 AM
Unknown Object (File)
Oct 3 2025, 3:43 PM
Unknown Object (File)
Sep 26 2025, 2:12 AM
Unknown Object (File)
Sep 16 2025, 4:25 PM
Subscribers

Details

Summary

The header file contains only stuff relevant in the kernel context.

There is no #warning or #error in case the header file is not included in the kernel context, since then this header file would need to be added to tools/build/test-includes/badfiles.inc, but that list should not grow.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tuexen retitled this revision from tcp: restrict all symbols in tcp_timer.h to the kernel to tcp: restrict the contents of tcp_timer.h to the kernel context.

There is no #warning or #error in case the header file is not included in the kernel context, since then this header file would need to be added to tools/build/test-includes/badfiles.inc, but that list should not grow.

Yeah, I also tried that. But that's the whole point, we want it to be a bad include :)

I'll add Warner to get his opinion on how to cover this case. This actually is a common case. We leak a kernel header to userland and after years appears some accidental use of it.

This looks good to me. It's the usual way we deal with stuff like this

Thanks, @imp! What if instead of allowing the header but masking its internals, we want to eliminate any use of a header by userland applications? Some headers have #error no user serviceable parts inside and AFAIU all of them are listed in badfiles.inc. Is this the way to go?

This revision is now accepted and ready to land.Jun 26 2025, 3:19 PM

We will sort out how to correctly put #error later.