29/09/2026 09:36, Morten Brørup:
> The IPv6 header bitfields "version", "ds", "ecn", and "flow_label"
> are not organized correctly on little endian architectures.
> On little endian, a 32-bit bitfield is allocated from the least
> significant bit of the host order word, but "vtc_flow" is stored in
> network order. All four fields therefore read and write the wrong
> bits. For example, setting "version" to 6 writes 0x60 into the last
> byte of the word.
> 
> "ds" and "flow_label" are not contiguous in memory on little endian,
> so no reordering of bitfields can express them.
> 
> Reverted the patch introducing these bitfields.
> 
> PS: There is a GCC attribute to fix this, but nothing similar is
> offered by Clang or MSVC:
> __attribute__((scalar_storage_order("big-endian")))
> 
> Bugzilla ID: 1679
> Fixes: cba27998dc81 ("net: add IPv6 traffic class and flow label fields")
> Cc: [email protected]
> 
> Reported-by: Maxime Leroy <[email protected]>
> Signed-off-by: Morten Brørup <[email protected]>
> Reviewed-by: Stephen Hemminger <[email protected]>

Applied, thanks.



Reply via email to