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

support TP_STATUS_CSUMNOTREADY #670

Open
M1cha opened this issue Aug 28, 2022 · 1 comment
Open

support TP_STATUS_CSUMNOTREADY #670

M1cha opened this issue Aug 28, 2022 · 1 comment

Comments

@M1cha
Copy link
Contributor

M1cha commented Aug 28, 2022

Currently, the dhcp client doesn't work in (some) VMs, in my case a LXD container communicating through a linux bridge.
I'm using the raw_socket phy to test this.

The reason for that is that - while the IPv4 checksum is valid - the UDP checksum is not since it's expected to be ignored even though it's non-zero.

To detect this we'd have to use recvmsg instead of read inside RawSocketDesc::recv. Getting this information to where it's needed might be quite invasive though because we need a way to tell udp::Repr::parse to ignore the checksum for some packets.

References: https://github.com/mirror/busybox/blob/e512aeb0fb3c585948ae6517cfdf4a53cf99774d/networking/udhcp/dhcpc.c#L952

@Dirbaio
Copy link
Member

Dirbaio commented Jan 15, 2023

Is the value in the checksum field not zero? If it's zero it should be accepted:

smoltcp/src/wire/udp.rs

Lines 118 to 124 in 1f7e1fa

// From the RFC:
// > An all zero transmitted checksum value means that the transmitter
// > generated no checksum (for debugging or for higher level protocols
// > that don't care).
if self.checksum() == 0 {
return true;
}

If it's garbage instead of zero then I'd say this is a Linux bug...

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

No branches or pull requests

2 participants