core/icmp: fix reply checksum when request checksum >= 0xf800

need to add +1
This commit is contained in:
Florent Kermarrec 2019-02-24 23:30:28 +01:00
parent 77fa4bfb1e
commit b4c1cfe8c5
1 changed files with 1 additions and 1 deletions

View File

@ -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