mirror of
https://github.com/go-ping/ping.git
synced 2026-02-21 23:53:28 +00:00
* Fix unprivileged packet matching on Linux * Compute statistics on-the-fly as packets are received Signed-off-by: Jean Raby <jean@raby.sh> Signed-off-by: Charlie Jonas <charlie@charliejonas.co.uk> Co-authored-by: Charlie Jonas <charlie@charliejonas.co.uk>
17 lines
284 B
Go
17 lines
284 B
Go
// +build !linux,!windows
|
|
|
|
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 {
|
|
if ID != p.id {
|
|
return false
|
|
}
|
|
return true
|
|
}
|