[PATCH v2] net: revert add IPv6 traffic class and flow label fields
Thomas Monjalon
thomas at monjalon.net
Mon Oct 12 23:24:08 CEST 2026
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: stable at dpdk.org
>
> Reported-by: Maxime Leroy <maxime at leroys.fr>
> Signed-off-by: Morten Brørup <mb at smartsharesystems.com>
> Reviewed-by: Stephen Hemminger <stephen at networkplumber.org>
Applied, thanks.
More information about the dev
mailing list