gatus/vendor/github.com/go-ping/ping/utils_linux.go
2021-10-03 22:15:20 -04:00

20 lines
363 B
Go

// +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
}