[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3] net: Transmit zero UDP checksum as 0xFFFF

From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3] net: Transmit zero UDP checksum as 0xFFFF
Date: Wed, 15 Nov 2017 21:55:50 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 11/15/2017 09:07 PM, Ed Swierk via Qemu-devel wrote:


> 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 <address@hidden>
> ---

...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

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]