zmap / zmap

ZMap is a fast single packet network scanner designed for Internet-wide network surveys.
https://zmap.io
Apache License 2.0
5.51k stars 914 forks source link

Fixed bug that led to inaccurate max_packet_length based on TCP Options #853

Closed phillip-stephens closed 6 months ago

phillip-stephens commented 6 months ago

The module's max_packet_length is used for accurately computing the send rate to stay under any user-given bandwidth limitations.

This bug meant that the packet length was only accurate for the case where no TCP options were used (--probe-args="none") and incorrect for all other options.

Testing

Before fix, --probe-args="windows" -B 1G and --probe-args="linux" -B 1G would give the same send rate on a non-bandwidth constrained system, even though windows sends 8 bytes less per probe packet.

After fix, the same test results in 1.34 Mpps for windows and 1.24 Mpps for linux.