Host-only networking virtual device inserts incorrect UDP checksum (checksum offloading) in rare case
|Reported by:||Pierre L||Owned by:|
|Guest type:||all||Host type:||all|
When using host-only networking with a transmitting guest OS that offloads the Internet checksum to hardware, in a certain rare case the inserted checksum is incorrect, such that it is discarded by the destination OS.
Instructions to reproduce:
- send the attached packet (unfilledchecksum.pcap) through host-only networking, making sure the sending guest OS takes advantage of checksum offloading
- the packet is received by the other guest OS with checksum value 0xFFFF
- the packet is received by the other guest OS with checksum value 0x0000 as seen in illegalchecksum.pcap. As a result, packet is dropped by that other guest OS (Linux) and never reaches the destination socket.
Notes: as the UDP checksum scope includes the IP header, you will need to use the same source and destination addresses, among other data. The correct checksum value comes from Wireshark, and is consistent with this sentence in RFC 768: "If the computed checksum is zero, it is transmitted as all ones (the equivalent in one's complement arithmetic)"; as of revision 86228 of DevE1000.cpp, this does not appear to be observed. While this issue was uncovered with UDP, TCP would appear to have the same issue, though I have not similarly checked its standards documents. For what it's worth, both guest OS are Linux, and at no point were raw sockets used, only regular datagram sockets in the AF_INET6 domain. Seen with Version 6.1.12 r139181 (Qt5.6.2). I do not have the development environment in place to include a patch.