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
F83181397: D34242.diff
Tue, May 7, 9:38 AM
Unknown Object (File)
Sat, Apr 27, 8:01 AM
Unknown Object (File)
Sat, Apr 27, 8:01 AM
Unknown Object (File)
Sat, Apr 27, 7:57 AM
Unknown Object (File)
Sat, Apr 27, 6:17 AM
Unknown Object (File)
Jan 17 2024, 5:57 PM
Unknown Object (File)
Dec 20 2023, 8:12 AM
Unknown Object (File)
Dec 20 2023, 5:35 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