I am programming in Python a
IP host-11-0-0-10.http > host-11-0-0-9.37516: Flags [R] [bad hdr length 40 - too long, > 20]
0x0000: 4500 0028 9ffc 4000 4006 84ad 0b00 000a
0x0010: 0b00 0009 0050 928c 554c 31d8 0000 0000
0x0020: a004 0000 f9b3 0000
The problem is in the TCP header. The
data offset field (that's what it's called in the RFC but it's often called
header length too), you have set to 10 (the first nibble of 0xa0 at offset 0x20 in your packet dump). That is the number of 32-bit words in the TCP header -- or the offset of the TCP payload. In this case it should be 5 (20 bytes).
40 is too long because the IP header already specified the total length of the packet, hence there are only 20 bytes left after the IP header.