From b4c1cfe8c55b8f8c7498be6554204075c2c46602 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Sun, 24 Feb 2019 23:30:28 +0100 Subject: [PATCH] core/icmp: fix reply checksum when request checksum >= 0xf800 need to add +1 --- liteeth/core/icmp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liteeth/core/icmp.py b/liteeth/core/icmp.py index bd07d10..13d0bbb 100644 --- a/liteeth/core/icmp.py +++ b/liteeth/core/icmp.py @@ -132,7 +132,7 @@ class LiteEthICMPEcho(Module): sink.connect(self.buffer.sink), self.buffer.source.connect(source), self.source.msgtype.eq(0x0), - self.source.checksum.eq(~((~self.buffer.source.checksum)-0x0800)) + self.source.checksum.eq(self.buffer.source.checksum + 0x800 + (self.buffer.source.checksum >= 0xf800)) ] # icmp