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
F166714907: D34242.id102612.diff
Sat, Aug 15, 8:27 PM
Unknown Object (File)
Fri, Aug 14, 7:59 PM
Unknown Object (File)
Thu, Aug 13, 8:43 PM
Unknown Object (File)
Wed, Aug 12, 2:39 AM
Unknown Object (File)
Tue, Aug 11, 1:26 AM
Unknown Object (File)
Mon, Aug 10, 10:34 PM
Unknown Object (File)
Mon, Aug 10, 5:32 PM
Unknown Object (File)
Mon, Aug 10, 10:25 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
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