Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/snclient/check_ping_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type ipOptionInformation struct {
}

// icmpEchoReply mirrors ICMP_ECHO_REPLY (ipexport.h).
// IcmpSendEcho parses the reply buffer itself and uses the native layout on 64-bit systems too.
// IcmpSendEcho parses the reply buffer itself, so the native layout is used on 64 bit as well.
type icmpEchoReply struct {
Address uint32
Status uint32
Expand Down Expand Up @@ -179,7 +179,7 @@ func (l *CheckPing) addPingResolveError(check *CheckData) error {
}

// pingAddress sends one echo per second, like ping.exe.
// Each packet needs its own goroutine because IcmpSendEcho is synchronous.
// Every packet runs in its own goroutine because IcmpSendEcho is synchronous.
func (l *CheckPing) pingAddress(ctx context.Context, address net.IP, perPacket time.Duration) []pingReply {
packets := int(l.packets)
replies := make(chan indexedPingReply, packets)
Expand Down Expand Up @@ -306,7 +306,7 @@ func icmpEcho4(address net.IP, timeout time.Duration) (rtt uint32, ttl uint8, st
if handle == 0 || windows.Handle(handle) == windows.InvalidHandle {
return 0, 0, 0, fmt.Errorf("IcmpCreateFile: %w", callErr)
}
defer procIcmpCloseHandle.Call(handle) //nolint:errcheck // cannot recover from a close failure
defer procIcmpCloseHandle.Call(handle) //nolint:errcheck // a close failure cannot be handled

ip4 := address.To4()
if ip4 == nil {
Expand Down Expand Up @@ -344,7 +344,7 @@ func icmpEcho6(address net.IP, timeout time.Duration) (rtt uint32, ttl uint8, st
if handle == 0 || windows.Handle(handle) == windows.InvalidHandle {
return 0, 0, 0, fmt.Errorf("Icmp6CreateFile: %w", callErr)
}
defer procIcmpCloseHandle.Call(handle) //nolint:errcheck // cannot recover from a close failure
defer procIcmpCloseHandle.Call(handle) //nolint:errcheck // a close failure cannot be handled

ip16 := address.To16()
if ip16 == nil {
Expand Down
Loading