Skip to content

ETH_P_* constants should be c_ushort #2057

Open
@AidanWoolley

Description

@AidanWoolley

ETH_P_* constants (and probably more I haven't stumbled across) should be defined as c_ushorton linux x86-64 rather than c_int for 2 related reasons:

  1. To improve ease of use with the various sockaddr_* structs where they most often get used.
  2. Because when they are converted to big endian network ordering for use in those structs, (0x00000003).to_be() != (0x0003).to_be(), which is a really irritating gotcha.

I'm happy to do a find-and-replace to get those (and any others which people think should be changed) if you think it's a sane change.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions