Skip to content

GRE tunnel iflags/oflags have the wrong endianness #531

Closed
@ThomasFaivre

Description

@ThomasFaivre

Hello!

I am currently using the IPRoute class to create some GRE interfaces, and I noticed that IFLAGS and OFLAGS have the wrong endianness.

It was correctly set until commit 2c207c5. I believe that issue #214 was misleading because commit c78babb was using the correct flag values, and 32 is not one of them.

According to the kernel iflags and oflags are supposed to be 'be16' (it is in 2c207c5 commitlog):

  •  nla_put_be16(skb, IFLA_GRE_IFLAGS, tnl_flags_to_gre_flags(p->i_flags)) ||
    
  • #define GRE_KEY __cpu_to_be16(0x2000)

GRE_KEY in little-endianness is the flag used in #214 test, and therefore the test is wrong.

I suggest reverting commit 2c207c5, and informing users that GRE flags should now use their correct value in big endian.

Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions