Closed obeleh closed 9 years ago
Thanks for the patch.
I was wondering. The current code is not thread safe because it uses the same packetID and sequence number over and over again.
Would you like me to provide a patch so that PacketId and Sequence Number are generated as follows:
def genId(ip):
# based on IP
return int(hashlib.sha1(ip).hexdigest(), 16) % 32768
def genSeq():
# based on Time
return int(time.time() * 10000.0) % 32768
Another possibility for genId
would be to convert the IP to an integer and then modulo it.
Changed receive response to not accept ICMP request messages. It was possible to receive the very request that was sent.