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)
|
dip)
|
||||||
shorts = struct.unpack('!hhhhhhhhhh', iphdr)
|
shorts = struct.unpack('!hhhhhhhhhh', iphdr)
|
||||||
shsum = sum(shorts)
|
shsum = sum(shorts)
|
||||||
ipsum = struct.pack('!h', (~shsum & 0xffff) - 2) # -2? WTF?
|
ipsum = struct.pack('!H', (~shsum & 0xffff))
|
||||||
iphdr = iphdr[:10] + ipsum + iphdr[12:]
|
iphdr = iphdr[:10] + ipsum + iphdr[12:]
|
||||||
|
|
||||||
tcphdr = struct.pack('!HHLLBBHHH',
|
tcphdr = struct.pack('!HHLLBBHHH',
|
||||||
|
|
Loading…
Reference in New Issue