http://www.perlmonks.org?node_id=1010642


in reply to Simple Construction of a RAW TCP/IP Packet.

Just to share, the code above working properly after updating TCP checksum generation parameter to:

my ($tcp_pseudo) = pack('a4a4CCnnnNNH2B8nvn', $src_host,$dst_host,0,$tcp_proto,$tcp_len, $src_port,$dst_port,$syn,$ack, $tcp_head_reserved,$tcp_all,$tcp_win,$null,$tcp_urg_ptr);