Skip to content

Commit cd9450a

Browse files
authored
Merge pull request #668 from darinkes/icmp_predefined
flow/predefined: fix handleARPICMPRequests
2 parents 2937cb0 + 60edf98 commit cd9450a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

flow/predefined.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ func handleARPICMPRequests(current *packet.Packet, context UserContext) bool {
6969
(answerPacket.GetICMPNoCheck()).Type = types.ICMPTypeEchoResponse
7070
ipv4.HdrChecksum = packet.SwapBytesUint16(packet.CalculateIPv4Checksum(ipv4))
7171
answerPacket.ParseL7(types.ICMPNumber)
72-
icmp.Cksum = packet.SwapBytesUint16(packet.CalculateIPv4ICMPChecksum(ipv4, icmp, answerPacket.Data))
72+
(answerPacket.GetICMPNoCheck()).Cksum = packet.SwapBytesUint16(
73+
packet.CalculateIPv4ICMPChecksum(
74+
answerPacket.GetIPv4NoCheck(),
75+
answerPacket.GetICMPNoCheck(),
76+
answerPacket.Data))
7377

7478
answerPacket.SendPacket(port.port)
7579

0 commit comments

Comments
 (0)