Page MenuHomeFreeBSD

Require uint32_t alignment for ipfw_insn
ClosedPublic

Authored by arichardson on Jan 1 2021, 1:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 6:26 PM
Unknown Object (File)
Dec 23 2023, 8:58 AM
Unknown Object (File)
Dec 20 2023, 2:51 PM
Unknown Object (File)
Aug 22 2023, 9:29 AM
Unknown Object (File)
Aug 8 2023, 12:32 AM
Unknown Object (File)
Aug 8 2023, 12:28 AM
Unknown Object (File)
Aug 8 2023, 12:22 AM
Unknown Object (File)
May 9 2023, 2:56 AM
Subscribers

Details

Summary

There are many casts of this struct to uint32_t, so we also need to ensure
that it is sufficiently aligned to safely perform this cast on architectures
that don't allow unaligned accesses. This fixes lots of -Wcast-align warnings.

Test Plan

fixes lots of compiler warnings

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/netinet/ip_fw.h
342

This could be _Alignas(uint32_t) with C11, but if we fall back to attribute((aligned)), we need an integer and can't use a type name.

This revision is now accepted and ready to land.Jan 19 2021, 10:24 AM

I have some doubts, that this change is safe. But probably we will see the result quickly.

This revision was automatically updated to reflect the committed changes.