Commit Graph

3 Commits

Author SHA1 Message Date
Marcelo Magallon
b89bb75386
Report whether or not the TTL value was read (#205)
In IPv6 a hop limit of 0 is valid, so the TTL the code is reporting is
actually a valid value in that case.

Initialize ttl to -1, so that in the case of not getting a TTL value
from the control message, we can let the rest of the code whether the
reported value was actually 0 or whether it couldn't be read.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com>
2022-05-23 16:54:11 +02:00
Cemre Mengu
6e2b003bff
Add ability to set TTL (#186) 2021-10-14 19:03:14 +01:00
Marcelo Magallon
ff8be33200
Provide an abstraction over icmp.PacketConn (#166)
The differences between IPv4 and IPv6 APIs can be moved to a single type so that we don't need to keep track of them all over the code. We can also split Run() into two parts: the top one sets up the listener and the bottom one sends and receives packets. In this way, the bottom part can be tested using a mock packet connection.
2021-05-07 00:38:00 +01:00