HomeFreeBSD

Cast pointer to uintptr_t to avoid alignment warnings.

Description

Cast pointer to uintptr_t to avoid alignment warnings.

Both struct ip and struct udphdr both have an aligment of 2, but the
cast from struct ip to a uint32_t pointer confused GCC 9 into raising
the required alignment to 4 and then raising a
-Waddress-of-packed-member error when casting to struct udphdr.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D31941

(cherry picked from commit dba02df30d536922727a7ea509514462452a247a)

Details

Provenance
jhbAuthored on Feb 12 2022, 12:04 AM
Reviewer
imp
Differential Revision
D31941: Cast pointer to uintptr_t to avoid alignment warnings.
Parents
rG48e6b7ad3557: ktls: Write-lock the INP when changing a transmit TLS session.
Branches
Unknown
Tags
Unknown