Skip to content

Commit

Permalink
uapi: fix big endian definition of ipv6_rpl_sr_hdr
Browse files Browse the repository at this point in the history
commit 07d46d9 upstream.

Following RFC 6554 [1], the current order of fields is wrong for big
endian definition. Indeed, here is how the header looks like:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Next Header  |  Hdr Ext Len  | Routing Type  | Segments Left |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| CmprI | CmprE |  Pad  |               Reserved                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

This patch reorders fields so that big endian definition is now correct.

  [1] https://tools.ietf.org/html/rfc6554#section-3

Fixes: cfa933d ("include: uapi: linux: add rpl sr header definition")
Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
IurmanJ authored and gregkh committed Feb 3, 2021
1 parent 921f48a commit c48f690
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/uapi/linux/rpl.h
Expand Up @@ -28,10 +28,10 @@ struct ipv6_rpl_sr_hdr {
pad:4,
reserved1:16;
#elif defined(__BIG_ENDIAN_BITFIELD)
__u32 reserved:20,
__u32 cmpri:4,
cmpre:4,
pad:4,
cmpri:4,
cmpre:4;
reserved:20;
#else
#error "Please fix <asm/byteorder.h>"
#endif
Expand Down

0 comments on commit c48f690

Please sign in to comment.