[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/10] dp8393x: Don't clobber packet checksum
From: |
Finn Thain |
Subject: |
[PATCH 10/10] dp8393x: Don't clobber packet checksum |
Date: |
Sat, 14 Dec 2019 12:25:57 +1100 |
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 <address@hidden>
---
hw/net/dp8393x.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index 8e66b1f5de..9f4162c98c 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -810,6 +810,7 @@ static ssize_t dp8393x_receive(NetClientState *nc, const
uint8_t * buf,
address += rx_len;
address_space_rw(&s->as, address,
MEMTXATTRS_UNSPECIFIED, (uint8_t *)&checksum, 4, 1);
+ address += 4;
rx_len += 4;
s->regs[SONIC_CRBA1] = address >> 16;
s->regs[SONIC_CRBA0] = address & 0xffff;
--
2.23.0
- [PATCH 00/10] Fixes for DP8393X SONIC device emulation, Finn Thain, 2019/12/13
- [PATCH 05/10] dp8393x: Update LLFA register, Finn Thain, 2019/12/13
- [PATCH 07/10] dp8393x: Implement TBWC0 and TBWC1 registers to restore buffer state, Finn Thain, 2019/12/13
- [PATCH 10/10] dp8393x: Don't clobber packet checksum,
Finn Thain <=
- [PATCH 09/10] dp8393x: Don't stop reception upon RBE interrupt assertion, Finn Thain, 2019/12/13
- [PATCH 04/10] dp8393x: Don't advance RX descriptor twice, Finn Thain, 2019/12/13
- [PATCH 06/10] dp8393x: Clear RRRA command register bit only when appropriate, Finn Thain, 2019/12/13
- [PATCH 02/10] dp8393x: Clean up endianness hacks, Finn Thain, 2019/12/13
- [PATCH 01/10] dp8393x: Mask EOL bit from descriptor addresses, Finn Thain, 2019/12/13
- [PATCH 03/10] dp8393x: Have dp8393x_receive() return the packet size, Finn Thain, 2019/12/13