Removing padding from UDP packets in python (Linux)

旧城冷巷雨未停 提交于 2019-12-08 09:16:43

问题


I am trying to remove null padding from UDP packets sent from a Linux computer. Currently it pads the size of the packet to 60 bytes.

I am constructing a raw socket using AF_PACKET and SOCK_RAW. I created everything from the ethernet frame header, ip header (in which I specify a packet size of less than 60) and the udp packet itself.

I send over a local network and the observed packet in wireshark has null padding. Any advice on how to overcome this issue?


回答1:


This is pretty much impossible without playing around with the Linux drivers. This isn't the best answer but it should guide anyone else looking to do this in the right direction.3

Type sudo ethtool -d eth0 to see if your driver has pad short packets enabled.



来源:https://stackoverflow.com/questions/26113419/removing-padding-from-udp-packets-in-python-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!