From 3e1dfcba49386abcae1f1d7197c7a505416e29d1 Mon Sep 17 00:00:00 2001 From: pi-rho Date: Mon, 28 Jan 2013 19:21:39 -0600 Subject: [PATCH] fix ip header checksums --- netarch/ip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netarch/ip.py b/netarch/ip.py index 3138dff..8865225 100644 --- a/netarch/ip.py +++ b/netarch/ip.py @@ -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',