Skip to content
Snippets Groups Projects
Commit bae112b8 authored by Finn Thain's avatar Finn Thain Committed by Jason Wang
Browse files

dp8393x: Don't clobber packet checksum


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: default avatarFinn Thain <fthain@telegraphics.com.au>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: default avatarLaurent Vivier <laurent@vivier.eu>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
parent ada74315
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment