diff --git a/ping.go b/ping.go index 1aae564..6b2c275 100644 --- a/ping.go +++ b/ping.go @@ -77,6 +77,7 @@ const ( trackerLength = len(uuid.UUID{}) protocolICMP = 1 protocolIPv6ICMP = 58 + maxPacketTimeout = time.Duration(math.MaxInt64) ) var ( @@ -522,6 +523,9 @@ func (p *Pinger) runLoop( func (p *Pinger) CheckInFlightPackets() { // Loop through each item in map + if p.PacketTimeout == maxPacketTimeout { + return + } currentTime := time.Now() for seq, pkt := range p.InFlightPackets { if pkt.DispatchedTime.Add(p.PacketTimeout).Before(currentTime) {