lwIP - A Lightweight TCP/IP stack - Bugs: bug #56288, IP forward problem with hardware...
You are not allowed to post comments on this tracker with your current authentication level.
bug #56288: IP forward problem with hardware and software checksum calculation interfaces
Submitter: | Mehran Msba <msba> | ||
Submitted: | Wed 08 May 2019 12:12:10 PM UTC | ||
Category: | IPv4 | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Fixed |
Privacy: | Public | Assigned to: | goldsimon |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | 2.0.2 |
Thu 24 Feb 2022 01:40:35 PM UTC, comment #3: |
Tom Gibson <tomgibson> |
Thu 30 Jan 2020 10:03:40 PM UTC, comment #2: Fixed by seting checksum fields of IP/UDP/TCP/ICMP to 0 in ip4_forward(). |
Simon Goldschmidt <goldsimon> |
Tue 14 May 2019 07:36:34 PM UTC, comment #1: Well, it seems the forwarding case just has been forgotten when adding the "hw checksum per interface" feature.
|
Simon Goldschmidt <goldsimon> |
Wed 08 May 2019 12:12:10 PM UTC, original submission:
Test Conditions
|
Mehran Msba <msba> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 3 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2020-01-30 | goldsimon | Status | None | Fixed | |
Assigned to | None | goldsimon | |||
Open/Closed | Open | Closed |
Powered by Savane 3.13-4448.
Corresponding source code
comment #2:
Hi Simon,
I have reviewed the commit which relates to this bug at https://git.savannah.nongnu.org/cgit/lwip.git/commit/?id=61c67fc2295e522c7a12175581d6928c3951c0bf and I believe the changes it includes may be causing an issue in our scenario.
We are using an i.MX RT 1050 EVKB with LWIP 2.2.0 which has a built in Ethernet interface, we are also using NXP's virtual RNDIS USB network driver which is software-based.
When forwarding packets from the Ethernet interface to the USB RNDIS interface (which definitely does not feature hardware checksum offload) checksums are being zeroed by the lines in this commit and then not subsequently recalculated. This is happening because CHKSUM_GEN_IP, CHKSUM_GEN_UDP, CHKSUM_GEN_TCP, CHKSUM_GEN_ICMP are all set to 1, i.e. generate checksums in software, however it would appear to me that for the software checksum use-case checksums should not be set to zero at these lines. Is this an error in the patch?
An additional observation that I had is that the other half of the if check appears to be looking to see if the output interface supports hardware-offload, however the pointer 'inp' refers to the the input interface. 'netif' is the output interface, would this be the correct interface to check for hardware offload support?
If my conclusions above are correc0t, should the check actually be more along the lines of
if (!CHECKSUM_GEN_IP || NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_IP))
? That is assuming that the latter check will be true in the case where 'netif' supports hardware offload.
Regards,
Tom Gibson