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)
Jan 17 2024, 5:57 PM
Unknown Object (File)
Dec 20 2023, 8:12 AM
Unknown Object (File)
Dec 20 2023, 5:35 AM
Unknown Object (File)
Nov 11 2023, 11:31 PM
Unknown Object (File)
Nov 8 2023, 4:24 PM
Unknown Object (File)
Nov 7 2023, 12:43 PM
Unknown Object (File)
Nov 4 2023, 11:08 PM
Unknown Object (File)
Oct 10 2023, 10:31 PM

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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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