I am working on integrating scapy with twisted, but I ran into this very weird bug on OSX that I can\'t seem to figure out.
Basically I am unable to send a valid TCP pac
An IP header is required to have a multiple of 32 bits to be valid. And there is also a padding area on the end.
So depending on the IP options set in the header — which occupies a variable amount of bits — one needs to count bits and padding.
Looks like different OSes handle this differently. One might consider that a clever OS would do this padding for you.