Searched hist:"0 ac43d9728a7916453a4d8f1cf09e5f47c7038fd" (Results 1 – 1 of 1) sorted by relevance
/freebsd/sys/netpfil/ipfw/ |
H A D | ip_dummynet.c | diff 0ac43d9728a7916453a4d8f1cf09e5f47c7038fd Mon Jan 09 21:51:51 CET 2017 Marius Strobl <marius@FreeBSD.org> In dummynet(4), random chunks of memory are casted to struct dn_*, potentially leading to fatal unaligned accesses on architectures with strict alignment requirements. This change fixes dummynet(4) as far as accesses to 64-bit members of struct dn_* are concerned, tripping up on sparc64 with accesses to 32-bit members happening to be correctly aligned there. In other words, this only fixes the tip of the iceberg; larger parts of dummynet(4) still need to be rewritten in order to properly work on all of !x86. In principle, considering the amount of code in dummynet(4) that needs this erroneous pattern corrected, an acceptable workaround would be to declare all struct dn_* packed, forcing compilers to do byte-accesses as a side-effect. However, given that the structs in question aren't laid out well either, this would break ABI/KBI. While at it, replace all existing bcopy(9) calls with memcpy(9) for performance reasons, as there is no need to check for overlap in these cases.
PR: 189219 MFC after: 5 days
|