mirror of https://github.com/dirtbags/netarch.git
fix ip header checksums
This commit is contained in:
parent
d429c3c3f9
commit
3e1dfcba49
|
@ -232,7 +232,7 @@ class TCP_Recreate(object):
|
|||
dip)
|
||||
shorts = struct.unpack('!hhhhhhhhhh', iphdr)
|
||||
shsum = sum(shorts)
|
||||
ipsum = struct.pack('!h', (~shsum & 0xffff) - 2) # -2? WTF?
|
||||
ipsum = struct.pack('!H', (~shsum & 0xffff))
|
||||
iphdr = iphdr[:10] + ipsum + iphdr[12:]
|
||||
|
||||
tcphdr = struct.pack('!HHLLBBHHH',
|
||||
|
|
Loading…
Reference in New Issue