ping/utils_linux.go
Marcelo E. Magallon 64d100b308 Goreleaser can no longer be installed using goreleaser.sh
This installation method was deprecated because the associated tool has
been deprecated.

Download "by hand" and run checks before trying to use binary.

Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com>
2022-04-27 09:11:44 +01:00

21 lines
380 B
Go

//go:build linux
// +build linux
package ping
// Returns the length of an ICMP message.
func (p *Pinger) getMessageLength() int {
return p.Size + 8
}
// Attempts to match the ID of an ICMP packet.
func (p *Pinger) matchID(ID int) bool {
// On Linux we can only match ID if we are privileged.
if p.protocol == "icmp" {
if ID != p.id {
return false
}
}
return true
}