On 11/15/2017 09:07 PM, Ed Swierk via Qemu-devel wrote: [meta-comment]
> The checksum algorithm used by IPv4, TCP and UDP allows a zero value > to be represented by either 0x0000 and 0xFFFF. But per RFC 768, a zero > UDP checksum must be transmitted as 0xFFFF, as 0x0000 is a special > value meaning no checksum. > > Substitute 0xFFFF whenever a checksum is computed as zero when > modifying a UDP datagram header. Doing this on IPv4 packets and TCP > segments is unnecessary but legal. Add a wrapper for > net_checksum_finish() that makes the substitution. > > (We can't just change net_checksum_finish(), as that function is also > used by receivers to verify checksums, and in that case the expected > value is always 0x0000.) This part below... > > v3: > > Leave net_tx_pkt_update_ip_checksums() alone since it's only computing > a partial sum of the IP pseudo-header. > > Rename wrapper to net_checksum_finish_nozero() for clarity. > > v2: > > Add a wrapper net_checksum_finish_hdr() rather than duplicating the > logic at every caller. ...through here, belongs... > > Signed-off-by: Ed Swierk <eswi...@skyportsystems.com> > --- ...here, after the --- separator (you can have more than one ---; 'git am' stops parsing at the first). It is data that is useful to reviewers, but will be meaningless a year from now when browsing git history (at which point we won't care how many revisions the patch went through on the list, but only what was checked in). -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature