I am appending ICMP data to the pkt after scapy is done building the ICMP header, so there will no way for scapy to know about the data beforehand. Hence, I am updating the checksum manually as it would be including the icmp header and icmp data. If there is a way to pass ICMP data to scapy.ICMP() then it would be able to compute the checksum correctly.