ValentinBELYN / icmplib

Easily forge ICMP packets and make your own ping and traceroute.
GNU Lesser General Public License v3.0
267 stars 45 forks source link

Traceroute: avg_rtt should be divided by packets_received #16

Closed patrickfnielsen closed 3 years ago

patrickfnielsen commented 3 years ago

In the traceroute module "avg_rtt" does not return the average but the total round trip.

Looking at how its implemented for the ping module, the following is missing:

    if packets_received:
        avg_rtt /= packets_received

I'll be happy to create a PR if you want, though it's a simple fix.

ValentinBELYN commented 3 years ago

Oh, I don't even know how I didn't see it! :sweat_smile:

If you have time, I will be happy to validate your PR. Otherwise I can take care of it this weekend. I am very busy this week.

Thanks for reporting this issue 👍