From nobody Mon Feb 9 00:39:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1576815819; cv=none; d=zohomail.com; s=zohoarc; b=FRs1sULYc83h9pagSfzzoUx+UhM8jz6AvMYfxHC3MSwlk+ugz1qtJ3vvWhvuUH/y5YXUvDCPFzA3jkMEj4+QGanKgJmXXtXVNY43WsMyVKfYxHb90nC5PNgErHqnvSO/bL3tjRZES7YPorUq/J4mkoi84KTW32DEslg+Cpf63lk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576815819; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g/rkiXvE3W6NuAbXWEAxuc/ZwTfc9m+4p0DiWPGI7sQ=; b=UExaBOczwYSnJggDisZMyR13mVYdv0gCL5UTtXbdwzolkKiTdmR3rgIZhkNKv+Ndsgd9X8NWIgIJ1is1a79TL61VntD3gdgmWDBJFzDrlhLhQ1EcdUQM/NngW6eEzVTGEy/TJOuVdL1cPutfaEKCwKu3oSrCX+5YRopJ1VrO0sY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157681581976789.0096624927603; Thu, 19 Dec 2019 20:23:39 -0800 (PST) Received: from localhost ([::1]:50510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ii9pC-00026g-4p for importer@patchew.org; Thu, 19 Dec 2019 23:23:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55765) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ii9ng-0008Tl-GL for qemu-devel@nongnu.org; Thu, 19 Dec 2019 23:22:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ii9nf-00022Q-8U for qemu-devel@nongnu.org; Thu, 19 Dec 2019 23:22:04 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:34452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ii9nf-00020M-13; Thu, 19 Dec 2019 23:22:03 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id A6E7628D42; Thu, 19 Dec 2019 23:22:02 -0500 (EST) To: Jason Wang , qemu-devel@nongnu.org Message-Id: In-Reply-To: References: From: Finn Thain Subject: [PATCH v2 08/13] dp8393x: Don't clobber packet checksum MIME-Version: 1.0 Date: Fri, 20 Dec 2019 15:17:46 +1100 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 98.124.60.144 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Laurent Vivier , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" A received packet consumes pkt_size bytes in the buffer and the frame checksum that's appended to it consumes another 4 bytes. The Receive Buffer Address register takes the former quantity into account but not the latter. So the next packet written to the buffer overwrites the frame checksum. Fix this. Signed-off-by: Finn Thain Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/dp8393x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 46b92ebf65..d722bbe8c1 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -813,6 +813,7 @@ static ssize_t dp8393x_receive(NetClientState *nc, cons= t uint8_t * buf, address +=3D rx_len; address_space_rw(&s->as, address, MEMTXATTRS_UNSPECIFIED, (uint8_t *)&checksum, 4, 1); + address +=3D 4; rx_len +=3D 4; s->regs[SONIC_CRBA1] =3D address >> 16; s->regs[SONIC_CRBA0] =3D address & 0xffff; --=20 2.23.0