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

Passthru: Invalid ip checksum on loopback packet causing error #305

Open
SizzlingCalamari opened this issue May 14, 2022 · 2 comments
Open

Comments

@SizzlingCalamari
Copy link

  • Hardware checksum offload is enabled
  • Running the passthru.c example compiled locally
  • Client and server running locally are sending packets to/from each other (loopback).

When passthru is running, WinDivertRecvEx is showing packets from the client to the server as not having valid ip checksums (addr->IPChecksum is 0). A missing ip checksum makes sense because checksum offload is enabled, but causes passthru to fail because WinDivertSendEx expects valid checksums from the addr.

I'm not sure where afterwards in the chain the failure happens, but adding a call to WinDivertHelperCalcChecksums before WinDivertSendEx allows passthru to work in my case.

Is there something here that needs fixing in WinDivertSendEx? or is it the sample code that's just incorrect?

@SizzlingCalamari
Copy link
Author

To be clear, WinDivertSendEx is not returning false, it just silently fails.

@basil00
Copy link
Owner

basil00 commented Jun 7, 2022

If addr->IPChecksum is zero, then it should still be possible to inject the packet with WinDivertSendEx. In this case, the driver is supposed to call WinDivertHelperCalcChecksums internally.

So I am not sure why it would not be working. I will try to do some testing and get back on this.

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

No branches or pull requests

2 participants