[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL V2 08/23] dp8393x: Don't clobber packet checksum
From: |
Jason Wang |
Subject: |
[PULL V2 08/23] dp8393x: Don't clobber packet checksum |
Date: |
Tue, 3 Mar 2020 18:10:27 +0800 |
From: Finn Thain <address@hidden>
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>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <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 911f59e..6329341 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -818,6 +818,7 @@ static ssize_t dp8393x_receive(NetClientState *nc, const
uint8_t * buf,
address += rx_len;
address_space_write(&s->as, address, MEMTXATTRS_UNSPECIFIED,
&checksum, 4);
+ address += 4;
rx_len += 4;
s->regs[SONIC_CRBA1] = address >> 16;
s->regs[SONIC_CRBA0] = address & 0xffff;
--
2.5.0
- [PULL V2 14/23] dp8393x: Don't stop reception upon RBE interrupt assertion, (continued)
- [PULL V2 14/23] dp8393x: Don't stop reception upon RBE interrupt assertion, Jason Wang, 2020/03/03
- [PULL V2 16/23] NetRxPkt: Introduce support for additional hash types, Jason Wang, 2020/03/03
- [PULL V2 21/23] net/filter.c: Add Options to insert filters anywhere in the filter list, Jason Wang, 2020/03/03
- [PULL V2 06/23] dp8393x: Clear RRRA command register bit only when appropriate, Jason Wang, 2020/03/03
- [PULL V2 07/23] dp8393x: Implement packet size limit and RBAE interrupt, Jason Wang, 2020/03/03
- [PULL V2 15/23] e1000e: Avoid hw_error if legacy mode used, Jason Wang, 2020/03/03
- [PULL V2 20/23] tests/test-replication.c: Add test for for secondary node continuing replication, Jason Wang, 2020/03/03
- [PULL V2 19/23] block/replication.c: Ignore requests after failover, Jason Wang, 2020/03/03
- [PULL V2 22/23] colo: Update Documentation for continuous replication, Jason Wang, 2020/03/03
- [PULL V2 23/23] l2tpv3: fix RFC number typo in qemu-options.hx, Jason Wang, 2020/03/03
- [PULL V2 08/23] dp8393x: Don't clobber packet checksum,
Jason Wang <=
- [PULL V2 09/23] dp8393x: Use long-word-aligned RRA pointers in 32-bit mode, Jason Wang, 2020/03/03
- [PULL V2 18/23] hw: net: cadence_gem: Fix build errors in DB_PRINT(), Jason Wang, 2020/03/03
- Re: [PULL V2 00/23] Net patches, Peter Maydell, 2020/03/03