Page MenuHomeFreeBSD

tcp: Avoid conditionally defined fields in union lro_address
ClosedPublic

Authored by markj on Feb 10 2022, 6:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 4 2024, 12:10 PM
Unknown Object (File)
Sep 19 2024, 6:17 PM
Unknown Object (File)
Sep 17 2024, 6:13 AM
Unknown Object (File)
Sep 7 2024, 9:50 PM
Unknown Object (File)
Sep 7 2024, 1:58 AM
Unknown Object (File)
Sep 4 2024, 9:26 PM
Unknown Object (File)
Aug 7 2024, 10:41 PM
Unknown Object (File)
Jul 6 2024, 9:48 AM

Details

Summary

The layout of the structure ends up depending on whether the including
file includes opt_inet.h and opt_inet6.h, so different compilation units
can end up seeing different versions of the structure. Fix this by
unconditionally defining the address fields.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44391
Build 41279: arc lint + arc unit

Event Timeline

markj requested review of this revision.Feb 10 2022, 6:04 PM

I found this because there are multiple definitions of lro_address, lro_parser, etc. in the CTF info for the kernel, caused by this mismatch. In general it's a bad idea to conditionally define fields in header files, unless it is guaranteed that all compilation units will evaluate the condition the same way.

This revision is now accepted and ready to land.Feb 10 2022, 6:50 PM