Skip to content

Commit

Permalink
reset sent time to be after resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
clinta committed Mar 30, 2018
1 parent 67b1302 commit adf2e79
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ping/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (h *HostConn) getNextPing() (*ping.Ping, error) {
dst, err := net.ResolveIPAddr("ip", h.host)
changed := dst == nil || h.ipc == nil || h.ipc.dst == nil || !dst.IP.Equal(h.ipc.dst.IP)
if err != nil {
p.Sent = time.Now()
return p, err
}
if changed {
Expand All @@ -70,10 +71,12 @@ func (h *HostConn) getNextPing() (*ping.Ping, error) {
}
h.ipc, err = h.s.newipConn(dst, h.handle, h.timeout)
if err != nil {
p.Sent = time.Now()
return p, err
}
}
}
p.Sent = time.Now()
return p, nil
}

Expand Down

0 comments on commit adf2e79

Please sign in to comment.