Re: [ulogd2 PATCH 15/26] input: UNIXSOCK: prevent unaligned pointer access.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021-10-30, at 19:42:25 +0200, Jan Engelhardt wrote:
> On Saturday 2021-10-30 18:44, Jeremy Sowden wrote:
> >`struct ulogd_unixsock_packet_t` is packed, so taking the address of its
> >`struct iphdr payload` member may yield an unaligned pointer value.
>
> That may not be a problem. Dereferencing through a pointer to
> a packed struct generates very pessimistic code even when there is no
> padding internally:

Having taken another look at this, I've adopted different approach to
pacify the compiler: the pointer is only actually dereferenced to read
one member (`ip->version`), so I shall replace the local pointer
variable with an `ip_version` variable instead.

J.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux