Page MenuHomeFreeBSD

Require uint32_t alignment for ipfw_insn
ClosedPublic

Authored by arichardson on Jan 1 2021, 1:41 PM.
Tags
None
Referenced Files
F154273092: D27879.id.diff
Mon, Apr 27, 1:00 PM
Unknown Object (File)
Fri, Apr 24, 4:17 PM
Unknown Object (File)
Thu, Apr 23, 2:40 PM
Unknown Object (File)
Wed, Apr 22, 11:50 PM
Unknown Object (File)
Wed, Apr 22, 2:19 PM
Unknown Object (File)
Wed, Apr 22, 2:10 PM
Unknown Object (File)
Mon, Apr 20, 7:15 PM
Unknown Object (File)
Mon, Apr 20, 12:19 PM
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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35838
Build 32727: arc lint + arc unit

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.