From: "Michael S. Tsirkin" <mst@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: dwu@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] e1000: Fix TCP checksum overflow with TSO
Date: Mon, 8 Nov 2010 12:51:58 +0200 [thread overview]
Message-ID: <20101108105158.GA983@redhat.com> (raw)
In-Reply-To: <20101105205148.8161.25164.stgit@s20.home>
On Fri, Nov 05, 2010 at 02:52:08PM -0600, Alex Williamson wrote:
> When adding the length to the pseudo header, we're not properly
> accounting for overflow.
>
> From: Mark Wu <dwu@redhat.com>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Thanks, applied.
> ---
>
> hw/e1000.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/hw/e1000.c b/hw/e1000.c
> index 532efdc..677165f 100644
> --- a/hw/e1000.c
> +++ b/hw/e1000.c
> @@ -384,9 +384,12 @@ xmit_seg(E1000State *s)
> } else // UDP
> cpu_to_be16wu((uint16_t *)(tp->data+css+4), len);
> if (tp->sum_needed & E1000_TXD_POPTS_TXSM) {
> + unsigned int phsum;
> // add pseudo-header length before checksum calculation
> sp = (uint16_t *)(tp->data + tp->tucso);
> - cpu_to_be16wu(sp, be16_to_cpup(sp) + len);
> + phsum = be16_to_cpup(sp) + len;
> + phsum = (phsum >> 16) + (phsum & 0xffff);
> + cpu_to_be16wu(sp, phsum);
> }
> tp->tso_frames++;
> }
prev parent reply other threads:[~2010-11-08 10:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-05 20:52 [Qemu-devel] [PATCH] e1000: Fix TCP checksum overflow with TSO Alex Williamson
2010-11-08 10:51 ` Michael S. Tsirkin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101108105158.GA983@redhat.com \
--to=mst@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=dwu@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.