Files
kubevpn/vendor/github.com/prometheus-community/pro-bing/utils_linux.go
2023-10-21 22:41:53 +08:00

21 lines
383 B
Go

//go:build linux
// +build linux
package probing
// 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
}