Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Simple Construction of a RAW TCP/IP Packet.

by Anonymous Monk
on Mar 14, 2015 at 19:35 UTC ( [id://1120076] : note . print w/replies, xml ) Need Help??


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

Please note that the checksum subroutine given in the OP is insidiously buggy for odd length arguments (which is never the case here). Since $num_short calculation is missing int(), the unpack template ends in ".5", which in turn inserts an erroneous element to the loop.

Anyone reading this thread is probably better served by searching for newer and more mature examples.