All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org
Cc: Keith Monahan <keith@techtravels.org>,
	Richard Henderson <richard.henderson@linaro.org>,
	Helge Deller <deller@gmx.de>
Subject: [PULL v2 7/8] i82596: Fix source address inserting
Date: Thu,  5 Nov 2026 23:31:21 +0100	[thread overview]
Message-ID: <20261105223122.8729-8-deller@kernel.org> (raw)
In-Reply-To: <20261105223122.8729-1-deller@kernel.org>

From: Helge Deller <deller@gmx.de>

Insert the source address after the destination instead of overwriting
bytes 6-11.

Noticed-by: Keith Monahan <keith@techtravels.org>
Signed-off-by: Helge Deller <deller@gmx.de>
---
 hw/net/i82596.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hw/net/i82596.c b/hw/net/i82596.c
index 6bcae73815..19e1bf47db 100644
--- a/hw/net/i82596.c
+++ b/hw/net/i82596.c
@@ -631,8 +631,14 @@ static int i82596_tx_process_frame(I82596State *s)
         return 0;
     }
 
-    if (I596_NO_SRC_ADD_IN == 0 && total_len >= ETH_ALEN * 2) {
+    if (I596_NO_SRC_ADD_IN == 0 && total_len >= ETH_ALEN) {
+        if (total_len + ETH_ALEN > sizeof(s->tx_buffer)) {
+            return 0;
+        }
+        memmove(&s->tx_buffer[ETH_ALEN * 2], &s->tx_buffer[ETH_ALEN],
+                total_len - ETH_ALEN);
         memcpy(&s->tx_buffer[ETH_ALEN], s->conf.macaddr.a, ETH_ALEN);
+        total_len += ETH_ALEN;
     }
 
     if (I596_PADDING && total_len < I596_MIN_FRAME_LEN) {
-- 
2.54.0



  parent reply	other threads:[~2026-11-05 22:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 22:31 [PULL v2 0/8] Hppa 715 cpu nic patches Helge Deller
2026-11-05 22:31 ` [PULL v2 1/8] target/hppa: Move emulated power button into CPU I/O region Helge Deller
2026-11-05 22:31 ` [PULL v2 2/8] target/hppa: Add special blr instruction for HP-UX 9.05 Helge Deller
2026-11-05 22:31 ` [PULL v2 3/8] lasi_i82596: Decode the PORT command from bits 3:0, not 7:0 Helge Deller
2026-11-05 22:31 ` [PULL v2 4/8] i82596: Implement 82596CA big-endian mode (SYSBUS bit 7) Helge Deller
2026-11-05 22:31 ` [PULL v2 5/8] i82596: Initialize variables at chip reset Helge Deller
2026-11-05 22:31 ` [PULL v2 6/8] i82596: Drop crc calculation Helge Deller
2026-11-05 22:31 ` Helge Deller [this message]
2026-11-05 22:31 ` [PULL v2 8/8] i82596: Various send- and transmit fixes for 715 Helge Deller
2026-11-06 16:46 ` [PULL v2 0/8] Hppa 715 cpu nic patches Richard Henderson

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=20261105223122.8729-8-deller@kernel.org \
    --to=deller@kernel.org \
    --cc=deller@gmx.de \
    --cc=keith@techtravels.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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.