Raw sockets and sendto in python

后端 未结 6 1910
余生分开走
余生分开走 2021-02-05 16:51

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

6条回答
  •  滥情空心
    2021-02-05 17:44

    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.

提交回复
热议问题