Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ControlMessageOwned::UdpGroSegments size mismatches the actual size #2403

Closed
zhaiyan920 opened this issue May 15, 2024 · 1 comment · Fixed by #2406
Closed

ControlMessageOwned::UdpGroSegments size mismatches the actual size #2403

zhaiyan920 opened this issue May 15, 2024 · 1 comment · Fixed by #2406

Comments

@zhaiyan920
Copy link

UdpGroSegments is declared as a u16 cmsg in the library but the Linux kernel actually puts an int in the cmsg:

https://elixir.bootlin.com/linux/latest/source/include/linux/udp.h#L145

So applications using this option will break on big endian Linux machines. To fix it, the size may need to be adjusted to the size of an int for related kernel versions (doubt kernel maintainers might not change this in hope to not break user space: https://lore.kernel.org/netdev/CANn89iL2PCnC=6dOrozW0309W==tWcKpj2iwZgZAD_s0amvzLA@mail.gmail.com/T/)

devnexen added a commit to devnexen/nix that referenced this issue May 15, 2024
The kernel, since 5.0, process the segmentation offload with a signed
int.

close nix-rust#2403.
@SteveLauC
Copy link
Member

SteveLauC commented May 17, 2024

IIUC, the Linux kernel itself is still using an unsigned short to store the gso_size, e.g., this one, it is just the (userspace) interfaces that are not using the correct type?

devnexen added a commit to devnexen/nix that referenced this issue May 18, 2024
The kernel, since 5.0, process the segmentation offload with a signed
int.

close nix-rust#2403.
github-merge-queue bot pushed a commit that referenced this issue May 22, 2024
…2406)

* fix ControlMessageOwned::UdpGroSegments UDP packets processing type.

The kernel, since 5.0, process the segmentation offload with a signed
int.

close #2403.

* changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants